Fix image dimension condition checks

Update index_profile.html
This commit is contained in:
oNya 2025-03-16 17:27:42 +08:00 committed by GitHub
parent 72615b6d49
commit f45b5a020d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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