From 6b1dc1626b9993e4b0005aff57b25d2cd5d01c9f Mon Sep 17 00:00:00 2001 From: Julien WITTOUCK Date: Fri, 1 Aug 2025 16:04:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20:=20only=20resize=20images=20lar?= =?UTF-8?q?ger=20than=20820px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/shortcodes/img-resized.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/img-resized.html b/layouts/shortcodes/img-resized.html index 9ffbaf8..8f012aa 100644 --- a/layouts/shortcodes/img-resized.html +++ b/layouts/shortcodes/img-resized.html @@ -1,4 +1,7 @@ {{ $original := .Page.Resources.GetMatch (.Get "src") }} -{{ $resized := $original.Resize "820x webp" }} +{{ $image := $original }} +{{ if gt $original.Width 820 }} + {{ $image = $original.Resize "820x webp" }} +{{ end }} - \ No newline at end of file + \ No newline at end of file -- 2.54.0