1

Optimisation des images

This commit is contained in:
2026-03-05 23:53:53 +01:00
parent c28e9ffeaa
commit 1a341d428e
4 changed files with 48 additions and 9 deletions

View File

@@ -71,8 +71,12 @@
{{- $coverImage = $page.Resources.GetMatch $coverPath -}}
{{- if $coverImage -}}
{{- $coverDisplay = $coverImage -}}
{{- if and (ne $coverDisplay.MediaType.SubType "svg") (gt $coverDisplay.Width 1480) -}}
{{- $coverDisplay = $coverImage.Resize "1480x" -}}
{{- if ne $coverDisplay.MediaType.SubType "svg" -}}
{{- $coverWidth := $coverDisplay.Width -}}
{{- if gt $coverDisplay.Width 1480 -}}
{{- $coverWidth = 1480 -}}
{{- end -}}
{{- $coverDisplay = $coverImage.Resize (printf "%dx webp q80" $coverWidth) -}}
{{- end -}}
{{- end -}}
{{- end -}}