From a722904938974d141743eb4b5dc6d3762106c886 Mon Sep 17 00:00:00 2001 From: rra Date: Sun, 24 Nov 2024 12:03:07 +0100 Subject: [PATCH] page resources are returned in reverse, so get the last image rather than the first --- themes/lumbung-theme/layouts/partials/shout_card.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/lumbung-theme/layouts/partials/shout_card.html b/themes/lumbung-theme/layouts/partials/shout_card.html index c3ee38b..7b29012 100644 --- a/themes/lumbung-theme/layouts/partials/shout_card.html +++ b/themes/lumbung-theme/layouts/partials/shout_card.html @@ -19,7 +19,8 @@ {{end}} {{ else if (.Resources.ByType "image") }} - {{ with (index (.Resources.ByType "image") 0) }} + {{/* Somehow the image resources are iterated in reverse, so we need to get the last one*/}} + {{ range last 1 (.Resources.ByType "image") }} {{ $img := . }} {{ $height := add .Height 0.0}} {{ $ratio := div $height .Width}}