fix-featimage-ratio #127

Merged
paspo merged 4 commits from paspo/bglug.it:fix-featimage-ratio into main 2024-07-17 21:37:19 +00:00
Showing only changes of commit f8d18536e7 - Show all commits

View File

@ -26,10 +26,12 @@
<span class="image featured">
{{- if in $rasters $img.MediaType.SubType -}}
{{- $img = $img.Resize (printf "x%d" $maxHeight) -}}
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="max-height: {{ $maxHeight }}px;" />
{{- 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 -}} />
{{ else }}
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="max-height: {{ $maxHeight }}px;" />
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" />
{{ end }}
</span>
{{ end }}