{{- $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 }}
{{- with $description }}

{{ . | markdownify }}

{{- end }} {{ $alt }} {{- if $data.prompt }}
Attribution : {{- with $data.attribution }}{{ . | markdownify }}{{- end }}

Prompt : {{ $data.prompt }}

{{- else }} {{- with $data.attribution }}

Attribution : {{ . | markdownify }}

{{- end }} {{- end }}