aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/author-header.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-11 23:15:33 -0400
committertdro <tdro@noreply.example.com>2022-06-11 23:15:33 -0400
commitea9c7faaaa82401bc8e32efd40c353a2696ac0b9 (patch)
treedb17f9cd7d6b720d3ea86a2afd76a6253de307e4 /themes/default/layouts/partials/author-header.html
parented5ac80fac302574d5643bf6f69066805d520075 (diff)
downloadcanory-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/partials/author-header.html')
-rw-r--r--themes/default/layouts/partials/author-header.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/themes/default/layouts/partials/author-header.html b/themes/default/layouts/partials/author-header.html
index 0261915..18738c4 100644
--- a/themes/default/layouts/partials/author-header.html
+++ b/themes/default/layouts/partials/author-header.html
@@ -3,18 +3,18 @@
{{- $image := resources.Get $path -}}
{{- $404origin := print "/images/404.png" -}}
{{- $404image := imageConfig (print "static/" $404origin) -}}
-{{- $dimensions := "x360" -}}
+{{- $dimensions := "600x360" -}}
{{- with $image -}}
{{- $image = .Content | resources.FromString (print "/data/static/images/" (. | urlize)) -}}
- <source srcset="{{- ($image.Resize (print $dimensions " webp")).RelPermalink -}}" type="image/webp" />
+ <source srcset="{{- ($image.Fit (print $dimensions " webp")).RelPermalink -}}" type="image/webp" />
{{- end -}}
<img
loading="lazy"
{{ if fileExists $path }}
{{- with $image -}}
- {{- $image = (.Content | resources.FromString (print "/data/static/images/" ($image | urlize))).Resize $dimensions -}}
+ {{- $image = (.Content | resources.FromString (print "/data/static/images/" ($image | urlize))).Fit $dimensions -}}
width="{{ $image.Width }}"
height="{{ $image.Height }}"
src="{{ $image.RelPermalink }}"