{{ $isJPG := eq (path.Ext .image) ".jpg" }} {{ $isPNG := eq (path.Ext .image) ".png" }} {{ if ($isJPG) -}} {{ $webpPath:= replace .image ".jpg" ".webp" }} {{ $webpPathStatic:= printf "static/%s" $webpPath }} {{ if (fileExists $webpPathStatic) -}} {{- end }} {{- end }} {{ if ($isPNG) -}} {{ $webpPath:= replace .image ".png" ".webp" }} {{ $webpPathStatic:= printf "static/%s" $webpPath }} {{ if (fileExists $webpPathStatic) -}} {{- end }} {{- end }} {{ $img := imageConfig (add "/static" (.image | safeURL)) }} {{ if .link }}{{ end }} {{ .alt }} {{ if .link }}{{ end }} {{ if .figcaption }}
{{ .figcaption }}
{{ end }}