diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b8731cd..7a4d32f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -26,10 +26,12 @@ {{- if in $rasters $img.MediaType.SubType -}} - {{- $img = $img.Resize (printf "x%d" $maxHeight) -}} - {{ .Params.image_alt }} + {{- if gt $img.Height $maxHeight -}} + {{- $img = $img.Resize (printf "x%d webp q50" $maxHeight) -}} + {{- end -}} + {{ .Params.image_alt }} {{ else }} - {{ .Params.image_alt }} + {{ .Params.image_alt }} {{ end }} {{ end }}