fix-featimage-ratio #127
@ -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 }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user