{{- if or ( .Get "caption" ) ( .Get "title" ) -}}
{{- with .Get "title" -}}

{{ . | markdownify | safeHTML }}

{{- end -}} {{- with .Get "caption" -}}

{{ . | markdownify | safeHTML }}

{{- end -}}
{{- end -}} {{- with (.Get "dir") -}} {{- $resources := $.Page.Resources.Match ( print . "/*" ) }} {{- range $resources -}} {{- $caption := .Name | replaceRE "\\..*" "" | humanize }} {{- $linkURL := print $.Page.Permalink ($.Get "dir") "/" .Name | absURL }}
{{- if eq .ResourceType "image" -}} {{ . }} {{- else if eq .ResourceType "video" -}} {{- if eq .MediaType "video/ogg" -}} {{- partial "media/audio.html" . -}} {{- else -}} {{- partial "media/video.html" ( dict "src" . "page_file_path" $.Page.File.Path ) -}} {{- end -}} {{- else if ( or ( ne .ResourceType "image" ) ( ne .ResourceType "video" ) ) -}} {{- errorf "No handling for resource of type %q" .ResourceType -}} {{- end -}} {{- if or ( .Params.title ) ( .Params.attr ) -}}
{{ if .Params.attrlink -}} {{- end -}} {{- if .Params.attr -}}

{{ .Params.attr | safeHTML }}{{ with .Params.attrlicence }} {{ . | safeHTML }}{{ end }}

{{- end -}} {{- if .Params.attrlink -}}
{{- end -}} {{- if .Params.href -}} {{- end -}} {{- if .Params.title -}}
{{- if .Params.titleLang -}} {{- end -}} {{ .Params.title | safeHTML }} {{- if .Params.titleLang -}} {{- end -}}
{{- else -}} {{- with .Params.href -}}

Link

{{- end -}} {{- end -}} {{- if .Params.href -}}
{{- end -}}
{{- end -}}
{{- end }} {{- else -}} {{ .Inner }} {{- end }}