From 637539e3e25711ad630e4654dc1d7508d0a6e6cb Mon Sep 17 00:00:00 2001 From: Earl Ng Date: Sun, 4 Oct 2020 19:14:57 +0800 Subject: card featured image should crop instead of resize Use .Resize will make the featured images seem distorted when displayed on cards if the featured images do not match the aspect ration of 700x350. Using .Fill instead will crop the image so that it does not look distorted. Source: https://gohugo.io/content-management/image-processing/#smart-cropping-of-images --- layouts/_default/card.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/card.html b/layouts/_default/card.html index 01c06fc..41b7c9c 100644 --- a/layouts/_default/card.html +++ b/layouts/_default/card.html @@ -5,7 +5,7 @@ {{- $images := . -}} {{- with $page.Site.GetPage "section" "images" -}} {{- with .Resources.GetMatch (strings.TrimPrefix "/images/" (index $images 0)) -}} - {{- $image := .Resize "700x350" -}} + {{- $image := .Fill "700x350" -}} {{ $page.Title }} {{- end -}} {{- end -}} -- cgit v1.2.3