{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} {{- $images := .Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{ $caption := "" }} {{ if .Params.featureimage }} {{- $url:= .Params.featureimage -}} {{- $caption = .Params.featureimagecaption -}} {{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} {{ end }} {{- $alt := .Page.Title -}} {{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}} {{- with $featured -}} {{ if $disableImageOptimization }} {{ with . }}
{{ $alt }} {{ if $caption }}
{{ $caption | markdownify }}
{{end}}
{{ end }} {{ else }} {{ with .Resize "1200x" }}
{{ $alt }} {{ if $caption }}
{{ $caption | markdownify }}
{{end}}
{{ end }} {{ end }} {{- end -}}