From 83facd78ec9c18127e0542aac2ba300dfd3c1383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 11 Jun 2022 16:13:05 +0300 Subject: [PATCH] update image resolution --- layouts/shortcodes/img.html | 61 +++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 61aaceb..469e4ad 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -9,7 +9,7 @@ care about is 700*4=2800px. {{ $src := resources.GetMatch (.Get "src") | resources.Fingerprint }} -{{ $max := $src | resources.Fingerprint }} +{{ $jmax := $src | resources.Fingerprint }} {{ $j350 := $src.Resize "350x" }} {{ $j700 := $src.Resize "700x" }} {{ $j1400 := $src.Resize "1400x" }} @@ -22,6 +22,7 @@ care about is 700*4=2800px. {{ errorf "missing value for param 'hint': %s" .Position }} {{ end }} {{ $hint := .Get "hint" }} +{{ $wmax := $src.Resize (printf "%dx%d webp" $src.Width $src.Height) }} {{ $w350 := $src.Resize (print "350x webp " $hint ) }} {{ $w700 := $src.Resize (print "700x webp " $hint ) }} {{ $w1400 := $src.Resize (print "1400x webp " $hint ) }} @@ -31,36 +32,44 @@ care about is 700*4=2800px. {{ with .Get "link" }}{{ end }}