{{- /* Resolves a front-matter "featured" path (relative to assets/) through Hugo's image pipeline. Hugo's Resize also scales up, so only convert to WebP and shrink when the source is wider than the given width. */ -}} {{- $path := .path -}} {{- $max := .max -}} {{- $class := .class -}} {{- $alt := .alt | default "" -}} {{- $loading := .loading | default "eager" -}} {{- with resources.Get $path -}} {{- $img := . -}} {{- if and (eq $img.ResourceType "image") (gt $img.Width $max) -}} {{- $img = $img.Resize (printf "%dx q82 webp" $max) -}} {{- end -}} {{ $alt }} {{- else -}} {{- warnf "featured image not found in assets: %s" $path -}} {{- end -}}