From 37f9ff9d8d0e1a170e33d72a36a6b8aae97160e0 Mon Sep 17 00:00:00 2001 From: sebousan Date: Wed, 9 Oct 2024 12:45:36 +0200 Subject: [PATCH] add lazy to item media and clean Scratch --- layouts/partials/docs/item/media.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/layouts/partials/docs/item/media.html b/layouts/partials/docs/item/media.html index 45b667b..27669d7 100644 --- a/layouts/partials/docs/item/media.html +++ b/layouts/partials/docs/item/media.html @@ -1,11 +1,14 @@ +{{- $noop := .Content -}}{{/* https://gohugo.io/troubleshooting/faq/#why-is-my-page-scratch-or-store-missing-a-value */}} {{- $desktop := site.Params.docs.thumbnail.desktop | default false -}} {{- $mobile := site.Params.docs.thumbnail.mobile | default false -}} {{- if .Scratch.Get "large" -}} {{- $desktop = site.Params.docs.thumbnail.desktop_large | default $desktop -}} {{- end -}} {{- if .Scratch.Get "scrollsnap" -}} - {{- $mobile = site.Params.docs.thumbnail.scrollsnap | default false -}} + {{- $mobile = site.Params.docs.thumbnail.scrollsnap | default $mobile -}} {{- end -}} +{{- $lazy := .Scratch.Get "lazy" | default true -}} +
{{ with .Params.image }} {{ partial "commons/image.html" (dict @@ -13,6 +16,7 @@ "alt" .alt "desktop" $desktop "mobile" $mobile + "lazy" $lazy "itemprop" "image" ) }} {{ else }} @@ -20,4 +24,8 @@ {{ end }} {{ end }} -
\ No newline at end of file + + +{{- .Scratch.Delete "lazy" -}} +{{- .Scratch.Delete "scrollsnap" -}} +{{- .Scratch.Delete "large" -}} \ No newline at end of file