1

Nouveau thème pour 2026

This commit is contained in:
2026-02-21 01:50:39 +01:00
parent 27dd5f86e6
commit a7f539ceb4
67 changed files with 6137 additions and 21 deletions

View File

@@ -0,0 +1,30 @@
{{- $page := . -}}
{{- $isLead := true -}}
{{- with $page.Params.dossier -}}
{{- $dossierID := index . 0 -}}
{{- if $dossierID -}}
{{- $group := where site.RegularPages "Params.dossier" "intersect" (slice $dossierID) -}}
{{- if gt (len $group) 1 -}}
{{- $weighted := slice -}}
{{- range $group -}}
{{- if isset .Params "weight" -}}
{{- $weighted = $weighted | append . -}}
{{- end -}}
{{- end -}}
{{- $candidates := $group -}}
{{- if gt (len $weighted) 0 -}}
{{- $sortedByWeight := sort $weighted "Weight" "asc" -}}
{{- $minWeight := (index $sortedByWeight 0).Weight -}}
{{- $candidates = where $sortedByWeight "Weight" $minWeight -}}
{{- end -}}
{{- $sortedByDate := sort $candidates "Date" "asc" -}}
{{- $firstDate := (index $sortedByDate 0).Date -}}
{{- $sameDate := where $sortedByDate "Date" $firstDate -}}
{{- $firstPage := index (sort $sameDate "RelPermalink" "asc") 0 -}}
{{- $isLead = eq $firstPage.File.Path $page.File.Path -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if $isLead -}}true{{- end -}}