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 }}