1
Files
2025/themes/2026/layouts/_partials/dossier-summary.html
2026-04-05 15:07:52 +02:00

40 lines
1.2 KiB
HTML

{{- $current := . -}}
{{- $showTitle := true -}}
{{- if reflect.IsMap . -}}
{{- with index . "Page" -}}
{{- $current = . -}}
{{- end -}}
{{- if isset . "ShowTitle" -}}
{{- $showTitle = index . "ShowTitle" -}}
{{- end -}}
{{- end -}}
{{- with $current.Params.dossier -}}
{{- $dossierID := index . 0 -}}
{{- if $dossierID -}}
{{- $allPages := site.RegularPages -}}
{{- $filtered := where $allPages "Params.dossier" "intersect" (slice $dossierID) -}}
{{- $sorted := sort $filtered "RelPermalink" "asc" -}}
{{- $sorted = sort $sorted "Date" "asc" -}}
{{- $sorted = sort $sorted "Weight" "asc" -}}
{{- if gt (len $sorted) 1 -}}
<nav aria-label="Sommaire du dossier">
{{- if $showTitle -}}
<p><strong>{{ $dossierID }}</strong></p>
{{- end -}}
<ol>
{{- range $sorted -}}
<li{{ if eq .Permalink $current.Permalink }} class="is-current"{{ end }}>
{{- if eq .Permalink $current.Permalink -}}
<strong aria-current="page">{{ .Title }}</strong>
{{- else -}}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{- end -}}
</li>
{{- end -}}
</ol>
</nav>
{{- end -}}
{{- end -}}
{{- end -}}