Files
2025-08-23 22:54:08 -02:30

13 lines
548 B
HTML

{{ $class := .class }}
{{ $alt := .alt }}
{{ $imgDict := .imgDict }}
{{ $base := default "/images/lazyimg" .imageBasePath }}
{{ $src := path.Join $base (strings.TrimPrefix "/" $imgDict.default.RelPermalink) }}
<img src="{{ $src }}"
class="{{ $class }}" loading="lazy"
{{ with $imgDict.default }} height="{{ .Height }}" width="{{ .Width }}" {{ end }}
{{ if $imgDict.responsive }}{{ with partial "renderer/_srcset" (merge $imgDict (dict "imageBasePath" $base)) }} srcset="{{ . }}"{{ end }}{{ end }}
{{ with $alt }} alt="{{ . }}" {{ end }}>