Optimisation des images
This commit is contained in:
@@ -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 -}}
|
||||
|
||||
Reference in New Issue
Block a user