incrociamo le dita

This commit is contained in:
Paolo Asperti 2024-07-20 08:14:47 +02:00
parent 6ef0012adf
commit f3794522f8
Signed by: paspo
GPG Key ID: 06D46905D19D5182

View File

@ -11,6 +11,7 @@
{{- if or .Params.image .Params.featured }}
{{- $maxHeight := 600 -}}
{{- $ratio := 2.33 -}}
{{ $rasters := slice "jpeg" "png" }}
{{- $img := "#" -}}
@ -29,7 +30,7 @@
{{- if gt $img.Height $maxHeight -}}
{{- $img = $img.Resize (printf "x%d webp q50" $maxHeight) -}}
{{- end -}}
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" {{- if gt $img.Height $img.Width -}}style="width: auto;"{{- end -}} />
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" {{- if ge (mul $img.Height $ratio) $img.Width -}}style="width: auto;" {{- end -}}/>
{{ else }}
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" />
{{ end }}