{{ $figcap := or .Title }} {{ $caption := or .Text " " }} {{ $alt := or .Text $figcap }} {{- if eq $figcap $caption -}} {{ $caption = " " }} {{- end -}} {{ $imageOriginal := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) }} {{ if $imageOriginal }} {{ if lt 1600 $imageOriginal.Width }} {{ $imageOriginal = ($imageOriginal.Resize "1600x q100").Permalink }} {{ end }} {{ else }} {{ $imageOriginal = .Destination }} {{ end }}