{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) -}} {{ $lqip := $image.Resize $.Site.Params.lqipWidth -}} {{ $imgSrc := "" -}} {{ $imgSrcSet := slice -}} {{ $widths := $.Site.Params.landscapePhotoWidths -}} {{ if gt $image.Height $image.Width -}} {{ $widths = $.Site.Params.portraitPhotoWidths -}} {{ end -}} {{ range $widths -}} {{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}} {{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}} {{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}} {{ end -}} {{ $imgSrcSet = (delimit $imgSrcSet ",") -}} {{ if eq .Site.Params.options.lazySizes true -}} {{ else -}} {{ end -}} {{ with .Get "caption" }}
{{ . | safeHTML }}
{{ end }}