{{- $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 "" -}} {{- $image := .Page.Resources.GetMatch $imgPath -}} {{- $isBlock := .IsBlock -}} {{- if $image }} {{- $resized := $image.Resize (cond (eq $isBlock true) "1024x" "500x") -}} {{- $large := $image.Resize "1920x" -}} {{- if $isBlock }}
{{- with $data.description }}

{{ . | markdownify }}

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

Prompt : {{ $data.prompt }}

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

Attribution : {{ . | markdownify }}

{{- end }} {{- end }}
{{- else }} {{ $alt }} {{- end }} {{- else }} {{- if $isBlock }}
{{ $alt }} {{- with $title }}
{{ . | markdownify }}
{{ end }}
{{- else }} {{ $alt }} {{- end }} {{- end }}