{{- $imgPath := .Destination -}} {{- $imgName := path.Base $imgPath | replaceRE "\\.[^.]+$" "" -}} {{- $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 := $data.description | default "" -}} {{- $image := .Page.Resources.GetMatch $imgPath -}} {{- 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)) -}}
{{ $alt }} {{- if $hasMeta -}}
{{- with $metaTitle -}}

{{ . | markdownify }}

{{- end -}} {{- with $description -}}

{{ . | markdownify }}

{{- end -}}
{{- if or $data.attribution $data.prompt -}}
{{- with $data.attribution -}}

Attribution : {{ . | markdownify }}

{{- end -}} {{- with $data.prompt -}}
Prompt

{{ . | markdownify }}

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