{{ $src := $.Page.Resources.GetMatch (.Get "src") }} {{ $link := $.Page.Resources.GetMatch (.Get "link") }} {{- if .Get "link" -}} {{- if $link }} {{ else }} {{ end }} {{- end -}} {{- if eq $src.ResourceType "image" -}} {{ with $src.Params.alt }}{{ . }}{{ else }}{{ .Get {{- else if eq $src.ResourceType "video" -}} {{- if eq $src.MediaType "video/ogg" -}}

Your browser doesn't support embedded audio, but you can view the audio here.

{{- else -}} {{- end -}} {{- else if or ( ne $src.ResourceType "image" ) ( ne $src.ResourceType "video" ) -}} {{- errorf "No handling for resource of type %q" $src.ResourceType -}} {{- end -}} {{- if .Get "link" }}{{ end -}} {{- if or (.Get "caption") ($src.Params.attr) -}}
{{- if $src.Params.attrlink -}} {{- end -}} {{- with $src.Params.attr -}}

{{ . | safeHTML }}{{ with $src.Params.attrlicence }} {{ . | safeHTML }}{{ end }}

{{- end -}} {{- if $src.Params.attrlink -}}
{{- end -}} {{- with $src.Params.title -}}

{{ . }}

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

{{ . | markdownify }}

{{- end -}}
{{- end -}}