Files
paige-hugo/layouts/partials/paige/tag-img.html
2025-03-03 18:44:01 -08:00

18 lines
1.1 KiB
HTML

{{ $params := . }}
{{ $alt := $params.alt }}
{{ $class := $params.class }}
{{ $height := $params.height }}
{{ $loading := $params.loading | default "eager" }}
{{ $origin := $params.crossorigin | default "anonymous" }}
{{ $policy := $params.referrerpolicy | default "no-referrer" }}
{{ $priority := $params.fetchpriority }}
{{ $sizes := $params.sizes }}
{{ $src := relLangURL $params.src }}
{{ $srcset := $params.srcset }}
{{ $style := $params.style }}
{{ $title := $params.title }}
{{ $width := $params.width }}
<img {{ with $alt }} alt="{{ . }}" {{ end }} {{ with $class }} class="{{ . }}" {{ end }} crossorigin="{{ $origin }}" {{ if and $priority (ne $priority "auto") }} fetchpriority="{{ $priority }}" {{ end }} {{ with $height }} height="{{ . }}" {{ end }} {{ if ne $loading "eager" }} loading="{{ $loading }}" {{ end }} referrerpolicy="{{ $policy }}" {{ with $sizes }} sizes="{{ . }}" {{ end }} src="{{ $src }}" {{ with $srcset }} {{ printf `srcset="%s"` . | safeHTMLAttr }} {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }} {{ with $width }} width="{{ . }}" {{ end }}>