forked from laurens/fediversity_website
Afbeeldingen 'above the fold' met normale prioriteit laden om layout-shift te voorkomen
This commit is contained in:
parent
1e4b8b5701
commit
e74c873b3b
|
@ -23,7 +23,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ $img := imageConfig (add "/static" (.image | safeURL)) }}
|
{{ $img := imageConfig (add "/static" (.image | safeURL)) }}
|
||||||
|
|
||||||
<img src="{{ .image | safeURL }}" alt="{{ .alt }}" loading="lazy" decoding="async" width="{{ $img.Width }}" height="{{ $img.Height }}">
|
<img src="{{ .image | safeURL }}" alt="{{ .alt }}"{{ if not .above_the_fold }} loading="lazy"{{ end }} decoding="async" width="{{ $img.Width }}" height="{{ $img.Height }}">
|
||||||
</picture>
|
</picture>
|
||||||
{{ if .figcaption }}
|
{{ if .figcaption }}
|
||||||
<figcaption>
|
<figcaption>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
{{ $personid := .id }}
|
{{ $personid := .id }}
|
||||||
{{ if .thumbnail }}
|
{{ if .thumbnail }}
|
||||||
{{ $alttext := printf "Foto van %s" .name }}
|
{{ $alttext := printf "Foto van %s" .name }}
|
||||||
{{ partial "show-image.html" (dict "context" . "image" .thumbnail "alt" $alttext) }}
|
{{ partial "show-image.html" (dict "context" . "image" .thumbnail "above_the_fold" true "alt" $alttext) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $text }}
|
{{ $text }}
|
||||||
|
|
||||||
|
|
Reference in a new issue