{{ $img := .img }}
{{ if not $img }}
{{ $img = resources.Get .url }}
{{ if not $img }}
{{ $img := resources.GetRemote .url | resources.Copy (path.Join "images" (path.Base .url )) }}
{{ end }}
{{ end }}
{{ if $img }}
{{ $url := $img.RelPermalink }}
{{ $width := $img.Width }}
{{ $height := $img.Height }}
{{ $sizes := slice "320" "640" "960" "1280" }}
{{ $ext := path.Ext $url }}
{{ $name := path.Base (replace $url $ext "") }}
{{ $dir := path.Dir $url }}
{{ $mediaWidthControl := "(min-width: 1240px) 50px, 70vw" }}
{{ else }}
{{ end }}
{{ .caption }}
{{ end }} {{ end }} {{/* https://www.brycewray.com/posts/2023/05/better-code-image-processing-hugo-render-hook-edition/ */}}