Add loading=lazy to img tags.

This commit is contained in:
Fredrik Jonsson 2024-01-30 19:34:52 +01:00
commit 0376f98512

View file

@ -54,7 +54,7 @@
{{ if $inline -}}
<div class="image image--svg{{ with $class }} {{ . }}{{ end }}">{{ $src | safeHTML }}</div>
{{ else -}}
<img class="image image--svg{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}"{{ if isset .Params "alt" }} alt="{{ $alt }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
<img class="image image--svg{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}" loading="lazy"{{ if isset .Params "alt" }} alt="{{ $alt }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
{{ end -}}
{{- if $link }}</a>{{ end }}
{{ if $caption -}}