Merge pull request #19332 from dvdksn/lazy-load-images

site: add lazy loading for images
This commit is contained in:
David Karlsson
2024-02-07 17:28:39 +01:00
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
class="cursor-pointer hover:opacity-90"
>
<img
loading="lazy"
src="{{ $imagePath }}"
alt="{{ .Text }}"
{{ with $width }}
@@ -39,6 +40,7 @@
{{ partial "icon" "close" }}
</button>
<img
loading="lazy"
class="rounded max-w-full max-h-full"
src="{{ $imagePath }}"
alt="{{ .Text }}"

View File

@@ -7,6 +7,7 @@
{{ end }}
<img
loading="lazy"
src="{{ $src }}"
alt="{{ $alt }}"
{{ with $title }}title="{{ . }}"{{ end }}