diff options
author | kdevo <kdevo@users.noreply.github.com> | 2021-04-11 02:17:31 +0300 |
---|---|---|
committer | kdevo <kdevo@users.noreply.github.com> | 2021-04-11 02:17:31 +0300 |
commit | 1fb73cf04ded99888e2f9c61846060bea29ed1a8 (patch) | |
tree | 443f06c7bc624d4525a2a1125be94773a036ee6b | |
parent | 59b7ab0b1b7e94d47f563ad5ee6eb8b79e498293 (diff) |
:bug: Keep logo aspect ratio, improve sane no-js behaviour
-rw-r--r-- | layouts/partials/logo-img.html | 4 | ||||
-rw-r--r-- | layouts/partials/sections/gallery/img.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/img.html | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/layouts/partials/logo-img.html b/layouts/partials/logo-img.html index 7978e92..e8b5e00 100644 --- a/layouts/partials/logo-img.html +++ b/layouts/partials/logo-img.html @@ -18,13 +18,13 @@ {{- else -}} {{ $scratch.Set "img" .Site.Params.logoBig }} {{- end }} +{{ if .Site.Params.Feat.useLazySizes }} <noscript> <img src="{{ $scratch.Get "img" }}" alt="{{ .Site.Title }}" class="home-logo logo-anim" loading="lazy" - style="height: auto;" {{ with $scratch.Get "imgH" -}} height="{{ . }}" {{- end }} @@ -33,6 +33,7 @@ {{ end }} > </noscript> +{{ end }} <img {{ if .Site.Params.Feat.useLazySizes }} {{ with $scratch.Get "imgPlaceholderRes" }} @@ -46,7 +47,6 @@ data-src="{{ $scratch.Get "img" }}" alt="{{ .Site.Title }}" class="home-logo blur-up logo-anim lazyload" - style="height: auto;" {{ else }} src="{{ $scratch.Get "img" }}" class="home-logo logo-anim" diff --git a/layouts/partials/sections/gallery/img.html b/layouts/partials/sections/gallery/img.html index 7dc5d12..fe2cd46 100644 --- a/layouts/partials/sections/gallery/img.html +++ b/layouts/partials/sections/gallery/img.html @@ -28,6 +28,7 @@ {{- end }} {{- end }} {{- end }} +{{ if .Site.Params.Feat.useLazySizes }} <noscript> <img src="{{ $scratch.Get "img" }}" @@ -42,6 +43,7 @@ {{ end }} > </noscript> +{{ end }} <img {{ if .Site.Params.Feat.useLazySizes }} {{ with $scratch.Get "imgPlaceholderRes" }} diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 38aab49..cde817e 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -4,6 +4,7 @@ {{ $height := $img.Height }} {{ $alt := default "" (.Get 2) }} +{{ if .Site.Params.Feat.useLazySizes }} <noscript> <img src="{{ $img.Permalink }}" @@ -14,6 +15,7 @@ height="{{ $height }}" width="{{ $width }}" > </noscript> +{{ end }} <img {{ if .Site.Params.Feat.useLazySizes }} data-src="{{ $img.Permalink }}" |