Add lazy loading to paige/image

master
Will Faught 3 years ago
parent 6510e3baf0
commit 83e493b52f

@ -10,7 +10,7 @@
{{ $src = .RelPermalink }} {{ $src = .RelPermalink }}
{{ end }} {{ end }}
{{ end }} {{ end }}
<img{{ with (.Get 4 | default (.Get `alt`)) }} alt="{{ . }}"{{ end }} class="figure-img img-fluid"{{ with .Get `height` }} height="{{ . }}"{{ end }} src="{{ $src }}"{{ with (.Get 3 | default (.Get `title`)) }} title="{{ . }}"{{ end }}{{ with .Get `width` }} width="{{ . }}"{{ end }}> <img{{ with (.Get 4 | default (.Get `alt`)) }} alt="{{ . }}"{{ end }} class="figure-img img-fluid"{{ with .Get `height` }} height="{{ . }}"{{ end }} loading="lazy" src="{{ $src }}"{{ with (.Get 3 | default (.Get `title`)) }} title="{{ . }}"{{ end }}{{ with .Get `width` }} width="{{ . }}"{{ end }}>
{{ if $link }} {{ if $link }}
</a> </a>
{{ end }} {{ end }}

Loading…
Cancel
Save