incrociamo le dita (#130)
fix #86 (hopefully) Reviewed-on: #130 Co-authored-by: paspo <paolo@asperti.com> Co-committed-by: paspo <paolo@asperti.com>
This commit is contained in:
parent
1880b71548
commit
149d7d424f
@ -11,6 +11,7 @@
|
|||||||
{{- if or .Params.image .Params.featured }}
|
{{- if or .Params.image .Params.featured }}
|
||||||
|
|
||||||
{{- $maxHeight := 600 -}}
|
{{- $maxHeight := 600 -}}
|
||||||
|
{{- $ratio := 2.33 -}}
|
||||||
{{ $rasters := slice "jpeg" "png" }}
|
{{ $rasters := slice "jpeg" "png" }}
|
||||||
{{- $img := "#" -}}
|
{{- $img := "#" -}}
|
||||||
|
|
||||||
@ -29,7 +30,7 @@
|
|||||||
{{- if gt $img.Height $maxHeight -}}
|
{{- if gt $img.Height $maxHeight -}}
|
||||||
{{- $img = $img.Resize (printf "x%d webp q50" $maxHeight) -}}
|
{{- $img = $img.Resize (printf "x%d webp q50" $maxHeight) -}}
|
||||||
{{- end -}}
|
{{- 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 }}
|
{{ else }}
|
||||||
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" />
|
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user