From 2b3da2c569f4ce50e0b03fe9c323f02cc4a9d1bb Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 14 Jul 2024 09:13:12 +0200 Subject: [PATCH 1/2] fix singleview con featured svg --- layouts/_default/single.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 945c758..14d28ea 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -11,6 +11,7 @@ {{- if or .Params.image .Params.featured }} {{- $maxHeight := 600 -}} + {{ $rasters := slice "jpeg" "png" }} {{- $img := "#" -}} {{- if .Params.image -}} @@ -22,11 +23,14 @@ {{/* se รจ stata definita un'immagine featured */}} {{- $img = .Page.Resources.GetMatch .Params.featured -}} {{- end -}} - - {{- $image := $img.Resize (printf "x%d" $maxHeight) -}} - {{ .Params.image_alt }} + {{- if in $rasters $img.MediaType.SubType -}} + {{- $img = $img.Resize (printf "x%d" $maxHeight) -}} + {{ .Params.image_alt }} + {{ else }} + {{ .Params.image_alt }} + {{ end }} {{ end }} -- 2.45.2 From ffe324bca19750bab94c76d8abfccace6f2226d9 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 14 Jul 2024 09:21:47 +0200 Subject: [PATCH 2/2] limita comunque l'altezza --- layouts/_default/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 14d28ea..010bbfa 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -29,7 +29,7 @@ {{- $img = $img.Resize (printf "x%d" $maxHeight) -}} {{ .Params.image_alt }} {{ else }} - {{ .Params.image_alt }} + {{ .Params.image_alt }} {{ end }} {{ end }} -- 2.45.2