This commit is contained in:
oNya 2025-04-23 14:35:23 -07:00 committed by GitHub
commit b36ab9fa54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,7 +13,7 @@
{{- end -}}
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
{{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}}
{{- if (not (and (not .imageHeight) (not .imageWidth))) }}
{{- if and .imageWidth .imageHeight }}
{{- $img = $img.Resize (printf "%dx%d" .imageWidth .imageHeight) }}
{{- else if .imageHeight }}
{{- $img = $img.Resize (printf "x%d" .imageHeight) }}