Préserver les GIF animés lors des transformations d'images
This commit is contained in:
@@ -41,8 +41,6 @@
|
||||
{{- $thumbnailTransform = "900x506" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $thumbnailOptions := printf "%s webp q80" $thumbnailTransform -}}
|
||||
|
||||
{{- $coverPath := $page.Params.cover -}}
|
||||
{{- $image := false -}}
|
||||
{{- if $coverPath -}}
|
||||
@@ -111,7 +109,11 @@
|
||||
<a href="{{ $page.RelPermalink }}">
|
||||
<figure>
|
||||
{{- with $image -}}
|
||||
{{- $resized := .Fill $thumbnailOptions -}}
|
||||
{{- $resized := partial "media/process-image.html" (dict
|
||||
"image" .
|
||||
"action" "Fill"
|
||||
"spec" $thumbnailTransform
|
||||
) -}}
|
||||
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
||||
{{- end -}}
|
||||
</figure>
|
||||
@@ -127,7 +129,11 @@
|
||||
<a href="{{ $page.RelPermalink }}">
|
||||
<figure>
|
||||
{{- with $image -}}
|
||||
{{- $resized := .Fill $thumbnailOptions -}}
|
||||
{{- $resized := partial "media/process-image.html" (dict
|
||||
"image" .
|
||||
"action" "Fill"
|
||||
"spec" $thumbnailTransform
|
||||
) -}}
|
||||
<img src="{{ $resized.RelPermalink }}" alt="Image de couverture pour {{ $page.Title }}" loading="lazy">
|
||||
{{- end -}}
|
||||
</figure>
|
||||
|
||||
Reference in New Issue
Block a user