1

Introduction du nouveau thème

This commit is contained in:
2025-10-11 00:36:18 +02:00
parent fa5ba208ed
commit 2653b0fa01
112 changed files with 1590 additions and 2766 deletions

View File

@@ -0,0 +1,41 @@
{{- $imgPath := .Destination -}}
{{- $imgName := path.Base $imgPath | replaceRE "\\.[^.]+$" "" -}} {{/* Supprime l'extension */}}
{{- $dataPath := printf "data/images/%s.yaml" $imgName -}}
{{- $dataFile := .Page.Resources.Get $dataPath -}}
{{- $data := dict -}}
{{- if $dataFile }}
{{- $data = $dataFile.Content | transform.Unmarshal -}}
{{- end }}
{{- $alt := .PlainText | default $data.title | default "" -}}
{{- $title := .Title | default $data.title | default .Page.Title -}}
{{- $description := default $data.description | default $title -}}
{{- $image := .Page.Resources.GetMatch $imgPath -}}
{{- $display := $image }}
{{- if gt $display.Height 810 }}
{{- $display = $image.Resize "x810" -}}
{{- end }}
<figure>
{{- with $description }}
<figcaption>
<p>{{ . | markdownify }}</p>
</figcaption>
{{- end }}
<a href="{{ $image.RelPermalink }}" title="Cliquez pour agrandir l'image">
<img src="{{ $display.RelPermalink }}" alt="{{ $alt }}" title="{{ $title }}" />
</a>
{{- if $data.prompt }}
<details>
<summary>
<strong>Attribution : {{- with $data.attribution }}<em>{{ . | markdownify }}</em>{{- end }}</strong>
</summary>
<p><strong>Prompt :</strong> <em>{{ $data.prompt }}</em></p>
</details>
{{- else }}
{{- with $data.attribution }}
<p class="details">
<strong>Attribution :</strong>
<em>{{ . | markdownify }}</em>
</p>
{{- end }}
{{- end }}
</figure>