{{- if .Get "link" -}} {{- end -}} {{- $u := urls.Parse (.Get "src") -}} {{- $src := $u.String -}} {{- if not $u.IsAbs -}} {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}} {{- $src = .RelPermalink -}} {{- end -}} {{- end -}} {{ with .Get {{- if .Get "link" }}{{ end -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
{{ with (.Get "title") -}} {{ . }} {{- end -}} {{- if or (.Get "caption") (.Get "attr") -}}

{{- .Get "caption" | markdownify -}} {{- with .Get "attrlink" }} {{- end -}} {{- .Get "attr" | markdownify -}} {{- if .Get "attrlink" }}{{ end }}

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