From f1fdec85de1d9f5d9fe5e0ae3b1ca560f0051295 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Wed, 8 Sep 2021 14:18:18 +0200 Subject: [PATCH] feat: update image shortcodes for disabling lazyload --- layouts/shortcodes/img-simple.html | 6 +++++- layouts/shortcodes/img.html | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/img-simple.html b/layouts/shortcodes/img-simple.html index 2ed9b98..117bc81 100644 --- a/layouts/shortcodes/img-simple.html +++ b/layouts/shortcodes/img-simple.html @@ -1,3 +1,7 @@ {{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) -}} {{ $lqip := $image.Resize $.Site.Params.lqipWidth -}} - \ No newline at end of file +{{ if eq .Site.Params.options.lazySizes true -}} + +{{ else -}} + +{{ end -}} \ No newline at end of file diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index a6bdaac..51a6a9d 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -17,7 +17,11 @@ {{ $imgSrcSet = (delimit $imgSrcSet ",") -}} - + {{ if eq .Site.Params.options.lazySizes true -}} + + {{ else -}} + + {{ end -}} {{ with .Get "caption" }}
{{ . | safeHTML }}
{{ end }}