vengono scalate solo le immagini più larghe di 1400

This commit is contained in:
Paolo Asperti 2024-07-17 22:58:25 +02:00
parent 8e873a40f3
commit a6936a9629
Signed by: paspo
GPG Key ID: 06D46905D19D5182

View File

@ -3,7 +3,11 @@
{{- if not $u.IsAbs -}}
{{- $path := strings.TrimPrefix "./" $u.Path }}
{{- with or (.PageInner.Resources.Get $path) (resources.Get $path) -}}
{{- $src = (.Resize "1400x jpg q50").RelPermalink -}}
{{- if gt .Width 1400 -}}
{{- $src = (.Resize "1400x jpg q50").RelPermalink -}}
{{- else -}}
{{- $src = .RelPermalink -}}
{{- end -}}
{{- with $u.RawQuery -}}
{{- $src = printf "%s?%s" $src . -}}
{{- end -}}