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 a6936a9629 - Show all commits

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 -}}