{{ $img := $.Page.Resources.GetMatch (.Get "src") }} {{ $file := $.Page.Resources.GetMatch (.Get "link") }} {{- if .Get "link" -}} {{- if $file }} {{ else }} {{ end }} {{- end -}} {{ if $img }} {{ with $img.Params.alt }}{{ . }}{{ else }}{{ .Get {{ end }} {{- if .Get "link" }}{{ end -}} {{- if or (.Get "caption") ($img.Params.attr) -}}
{{- if $img.Params.attrlink -}} {{- end -}} {{- with $img.Params.attr -}}

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

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

{{ . }}

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

{{ .Get "caption" | markdownify }}

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