{{ define "main" }}
{{ partial "header.html" . -}} {{- $isLiens := eq .Parent.Title "Liens intéressants" -}} {{- $mtop := cond $isLiens "0" "2rem" -}} {{- $coverPath := .Params.cover -}} {{- $img := false -}} {{- $coverData := dict -}} {{- if $coverPath -}} {{- $img = .Resources.GetMatch $coverPath -}} {{- if $img }} {{- $mtop = cond $isLiens "0" "100vh" -}} {{/* Traitement YAML associé à l’image de couverture */}} {{- $basename := path.Base $coverPath -}} {{- $filename := replaceRE "\\.[^.]+$" "" $basename -}} {{- $yamlPath := printf "data/images/%s.yaml" $filename -}} {{- $yamlFile := .Resources.GetMatch $yamlPath -}} {{- with $yamlFile }} {{- $yamlContent := .Content -}} {{- $coverData = $yamlContent | transform.Unmarshal -}} {{- end }}
{{ if $coverData.attribution }}
Attribution : {{ $coverData.attribution | markdownify }}
{{ end }}
{{- end }} {{- end }} {{- $context := . -}} {{- $context.Scratch.Set "paginationPosition" "down" -}}
{{- partial "dossier-summary" . -}}
{{- if $isLiens }} {{- with .Params.links }} {{- end }} {{- end }} {{ .Content }}
{{ if and $img (gt (len $coverData) 0) }} {{ end }} {{- $context.Scratch.Set "paginationPosition" "up" -}}
{{- partial "dossier-summary" . -}}
{{ end }}