{{ $file := replaceRE "^./" "" .Destination }} {{ $image := .Page.Resources.GetMatch (printf "%s" ($file | safeURL)) }} {{ $resized := "" }} {{ if strings.HasSuffix $image.RelPermalink ".gif" }} {{ $resized = $image }} {{ else }} {{ $resized = $image.Resize "694x" }} {{ end }} {{ $alt := .PlainText | safeHTML }} {{ $caption := "" }} {{ with .Title }} {{ $caption = . | safeHTML }} {{ end }} {{ if hasPrefix .Page.RelPermalink "/amp/" }} {{ else }} {{ if $alt }}{{ $alt }}{{ else if $caption }}{{ $caption | markdownify | plainify }}{{ else }} {{ end }} {{ end }}