+ {{$first_image := ""}}
+ {{$matches := findRESubmatch `]+)(?:'|")` .Content 1 }}
+ {{range $matches}}{{$first_image = index . 1}}{{end}}
+ {{with .Resources.Get $first_image}}
+ {{/* Check for resource type since some TIFFS show up as image, but can not do image operations. Then we can ignore them. */}}
+ {{if .ResourceType}}
+ {{ $height := add .Height 0.0}}
+ {{ $ratio := div $height .Width}}
+ {{ $thumb := .Fit "540x540 q80 webp"}}
+