diff options
author | tdro <tdro@noreply.example.com> | 2022-06-11 23:15:33 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-06-11 23:15:33 -0400 |
commit | ea9c7faaaa82401bc8e32efd40c353a2696ac0b9 (patch) | |
tree | db17f9cd7d6b720d3ea86a2afd76a6253de307e4 /themes/default/layouts/_default/_markup/render-image.html | |
parent | ed5ac80fac302574d5643bf6f69066805d520075 (diff) | |
download | canory-ea9c7faaaa82401bc8e32efd40c353a2696ac0b9.tar.gz canory-ea9c7faaaa82401bc8e32efd40c353a2696ac0b9.tar.bz2 canory-ea9c7faaaa82401bc8e32efd40c353a2696ac0b9.zip |
themes/default/layouts: Try fit instead of resize
Default to webp, and use fit method. Might produce better image
rendering overall.
Diffstat (limited to 'themes/default/layouts/_default/_markup/render-image.html')
-rw-r--r-- | themes/default/layouts/_default/_markup/render-image.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/themes/default/layouts/_default/_markup/render-image.html b/themes/default/layouts/_default/_markup/render-image.html index ba37989..3c027a9 100644 --- a/themes/default/layouts/_default/_markup/render-image.html +++ b/themes/default/layouts/_default/_markup/render-image.html @@ -5,7 +5,7 @@ {{- $width := "" -}} {{- $height := "" -}} {{- $cache := "" -}} -{{- $dimensions := "x360" -}} +{{- $dimensions := "600x360" -}} {{- with $remote -}} {{- with .Err -}} @@ -33,16 +33,16 @@ <a href="{{ $source }}"> <picture> {{- with $local }} - <source srcset="{{- ($local.Resize (print $dimensions " webp")).RelPermalink -}}" type="image/webp" /> - {{- $local = $local.Resize $dimensions }} + <source srcset="{{- ($local.Fit (print $dimensions " webp")).RelPermalink -}}" type="image/webp" /> + {{- $local = $local.Fit $dimensions }} {{- $width = $local.Width -}} {{- $height = $local.Height -}} {{- end }} {{- with $cache }} {{- $cache = .Content | resources.FromString (print "/data/static/images/" (. | urlize)) }} - <source srcset="{{- ($cache.Resize (print $dimensions " webp")).RelPermalink -}}" type="image/webp" /> + <source srcset="{{- ($cache.Fit (print $dimensions " webp")).RelPermalink -}}" type="image/webp" /> {{- $cache = .Content | resources.FromString (. | urlize) -}} - {{- $cache = $cache.Resize $dimensions }} + {{- $cache = $cache.Fit $dimensions }} {{- $width = $cache.Width -}} {{- $height = $cache.Height -}} {{- $cache = $cache.RelPermalink }} |