From 98a28b70ea9e409e543df5636201b80250ab95ee Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 14 Jul 2024 09:16:04 +0000 Subject: [PATCH] fix singleview con featured svg (#102) Reviewed-on: https://git.libreschool.org/BgLUG/bglug.it/pulls/102 Co-authored-by: paspo Co-committed-by: paspo --- 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..010bbfa 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 }}