diff options
author | kdevo <kdevo@users.noreply.github.com> | 2021-04-24 16:03:12 +0300 |
---|---|---|
committer | kdevo <kdevo@users.noreply.github.com> | 2021-04-24 16:03:12 +0300 |
commit | 2290dcf8bbbf46bc4b690128e48fc0ea913e9b97 (patch) | |
tree | 48ca6422d7f254f9b8aa3c9c98b45d8ed2f14710 /layouts | |
parent | 79b8aee23d410eeae2814a53820763b243d40197 (diff) |
:bug: Re-add useLQIP to make it configurable, change navlogo default size
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/body-top.html | 4 | ||||
-rw-r--r-- | layouts/partials/logo-img.html | 13 | ||||
-rw-r--r-- | layouts/partials/sections/gallery/img.html | 3 |
3 files changed, 11 insertions, 9 deletions
diff --git a/layouts/partials/body-top.html b/layouts/partials/body-top.html index c64152f..fa854a6 100644 --- a/layouts/partials/body-top.html +++ b/layouts/partials/body-top.html @@ -26,8 +26,8 @@ <div class="col-xs-6 col-sm-1 logo" style="{{ if not .IsHome }}visibility: visible;{{- end }}"> <a href="{{ "#" | relLangURL }}"> {{ $scratch := newScratch }} - {{ $imgSize := default "64x" .Site.Params.Image.NavLogo.resize }} - {{ $resizeOptions := default "q90" .Site.Params.Image.NavLogo.resizeOptions }} + {{ $imgSize := default "96x" .Site.Params.Image.NavLogo.resize }} + {{ $resizeOptions := default "q90 Gaussian" .Site.Params.Image.NavLogo.resizeOptions }} {{ with (resources.Get .Site.Params.logoSmall) -}} {{ $img := (slice (.Resize (printf "%s %s" $imgSize $resizeOptions))) | resources.Concat (printf "navlogo%s" (path.Ext .)) }} {{ $scratch.Set "img" $img.Permalink }} diff --git a/layouts/partials/logo-img.html b/layouts/partials/logo-img.html index 5adf037..803cd26 100644 --- a/layouts/partials/logo-img.html +++ b/layouts/partials/logo-img.html @@ -3,6 +3,7 @@ {{ $resize := default (printf "%dx" (cond (lt .Width 1200) .Width 1200)) $.Site.Params.Image.Logo.resize }} {{ $resizeOptions := default "MitchellNetravali q85" $.Site.Params.Image.Logo.resizeOptions }} {{ $resizeLQIP := default "200x" $.Site.Params.Image.Logo.resizeLQIP }} + {{ $useLQIP := default true $.Site.Params.Image.Logo.useLQIP }} {{ $responsive := default true $.Site.Params.Image.Logo.responsive }} {{ $name := default "homelogo" $.Site.Params.Image.Logo.name }} @@ -14,7 +15,7 @@ {{ $scratch.Set "imgH" $img.Height }} - {{ if $resizeLQIP -}} + {{ if $useLQIP -}} {{ $lqip := .Resize (printf "%s %s" $resizeLQIP $resizeOptions) }} {{ $scratch.Set "lqipRes" $lqip }} {{- end }} @@ -72,11 +73,11 @@ {{ if .Site.Params.Feat.useLazySizes }} {{ with $scratch.Get "lqipRes" }} {{ $placeholderB64 := .Content | base64Encode }} - {{ if gt (len $placeholderB64) 2048 -}} - src="{{ .Permalink }}" - {{- else -}} - src="data:{{ .MediaType }};base64,{{ $placeholderB64 }}" - {{- end }} + {{ if gt (len $placeholderB64) 3072 -}} + src="{{ .Permalink }}" + {{- else -}} + src="data:{{ .MediaType }};base64,{{ $placeholderB64 }}" + {{- end }} {{- end }} data-src="{{ $scratch.Get "img" }}" alt="{{ .Site.Title }}" diff --git a/layouts/partials/sections/gallery/img.html b/layouts/partials/sections/gallery/img.html index 4b276c2..2adc500 100644 --- a/layouts/partials/sections/gallery/img.html +++ b/layouts/partials/sections/gallery/img.html @@ -1,6 +1,7 @@ {{ $scratch := newScratch }} {{ $imgSize := default "500x" .Site.Params.Image.Gallery.resize }} {{ $lqipSize := default "6x" .Site.Params.Image.Gallery.resizeLQIP }} +{{ $useLQIP := default true .Site.Params.Image.Gallery.useLQIP }} {{ $resizeOptions := default "MitchellNetravali q85" .Site.Params.Image.Gallery.resizeOptions }} {{ with .Params.image -}} {{ with (resources.Get .) -}} @@ -9,7 +10,7 @@ {{ $scratch.Set "imgW" $image.Width }} {{ $scratch.Set "imgH" $image.Height }} - {{ if $lqipSize -}} + {{ if $useLQIP -}} {{ $lqip := $image }} {{ $lqip := $image | images.Filter (images.GaussianBlur 10) }} {{ $lqip = $lqip.Resize (printf "%s png" $lqipSize) }} |