{{ $url := urls.Parse .Destination }} {{ $altText := .Text }} {{ $caption := .Title }} {{ $class := "mx-auto my-0 rounded-md" }} {{ $file := $url.Path }} {{ $img := .Page.Resources.GetMatch $file }} {{- if and (not $img) .Page.File }} {{ $path := path.Join .Page.File.Dir $file }} {{ $img = resources.Get $path }} {{ end -}}
{{- with $img -}} {{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class) }} {{- else -}} {{ $altText }} {{- end -}} {{ with $caption }}
{{ . | markdownify }}
{{ end }}