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

@@ -13,10 +13,6 @@
{{- if not $image -}}
{{- return -}}
{{- end -}}
{{- $display := $image -}}
{{- if and (ne $display.MediaType.SubType "svg") (gt $display.Height 810) -}}
{{- $display = $image.Resize "x810" -}}
{{- end -}}
{{- $metaTitle := index $data "title" -}}
{{- $hasMeta := or $metaTitle (or $description (or $data.attribution $data.prompt)) -}}
{{- $attributes := .Attributes | default dict -}}
@@ -56,7 +52,13 @@
{{- end -}}
<figure class="{{ delimit $figureClasses " " }}">
<a href="{{ $image.RelPermalink }}" title="Cliquez pour agrandir l'image">
<img src="{{ $display.RelPermalink }}" alt="{{ $alt }}" title="{{ $title }}">
{{- partial "media/display-img.html" (dict
"image" $image
"showMeta" $showMeta
"forceCentered" $forceCentered
"alt" $alt
"title" $title
) -}}
</a>
{{- if $showMeta -}}
<figcaption class="figure-media-meta cover-meta">