altezza max immagine + gestione caso portrait
This commit is contained in:
parent
848dd5ebe0
commit
f8d18536e7
@ -26,10 +26,12 @@
|
|||||||
|
|
||||||
<span class="image featured">
|
<span class="image featured">
|
||||||
{{- if in $rasters $img.MediaType.SubType -}}
|
{{- if in $rasters $img.MediaType.SubType -}}
|
||||||
{{- $img = $img.Resize (printf "x%d" $maxHeight) -}}
|
{{- if gt $img.Height $maxHeight -}}
|
||||||
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="max-height: {{ $maxHeight }}px;" />
|
{{- $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 }}
|
{{ else }}
|
||||||
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="max-height: {{ $maxHeight }}px;" />
|
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user