From 177b0fd567ec58223912098e2369d3dc45f4bf95 Mon Sep 17 00:00:00 2001 From: Chris Banes Date: Thu, 15 Dec 2022 18:26:31 +0000 Subject: [PATCH] Improve resizing for article thumbnails Currently, the image is resized to be 600px, which will work for most images but caused issues for images which have very wide aspect ratios. This change updates the partials to use a Fill with an appropriate bounding box, rather than a simple resize. --- layouts/partials/article-link-card.html | 2 +- layouts/partials/article-link.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/article-link-card.html b/layouts/partials/article-link-card.html index 7d93982d..5b574688 100644 --- a/layouts/partials/article-link-card.html +++ b/layouts/partials/article-link-card.html @@ -13,7 +13,7 @@ {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- with $featured -}} - {{ with .Resize "600x" }} + {{ with .Fill "600x600" }}
{{ end }} {{- else -}} diff --git a/layouts/partials/article-link.html b/layouts/partials/article-link.html index 406790d3..b0f6ba57 100644 --- a/layouts/partials/article-link.html +++ b/layouts/partials/article-link.html @@ -32,7 +32,7 @@ {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} {{- with $featured -}} - {{ with .Resize "600x" }} + {{ with .Fill "600x400" }}
{{ end }} {{- else -}}