From 08036b566df3f2c4be55b6e75b63b42c80df85f1 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Fri, 6 Mar 2026 15:31:03 +0100 Subject: [PATCH] Ordre des blocs --- themes/2026/layouts/home.html | 46 +++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/themes/2026/layouts/home.html b/themes/2026/layouts/home.html index f1145a53..ac4f8fe7 100644 --- a/themes/2026/layouts/home.html +++ b/themes/2026/layouts/home.html @@ -104,13 +104,36 @@ {{- end -}} {{- $collectionsEntries = sort $collectionsEntries "LatestDateKey" "desc" -}} -{{- $critiquesDisplayed := slice -}} - {{- $critiquesCategoryDefs := slice -}} {{- $critiquesCategoryDefs = $critiquesCategoryDefs | append (dict "Path" "/critiques/films") -}} {{- $critiquesCategoryDefs = $critiquesCategoryDefs | append (dict "Path" "/critiques/series") -}} {{- $critiquesCategoryDefs = $critiquesCategoryDefs | append (dict "Path" "/critiques/jeux-video") -}} {{- $critiquesCategoryDefs = $critiquesCategoryDefs | append (dict "Path" "/critiques/livres") -}} +{{- $critiquesCategoryEntries := slice -}} +{{- range $critiqueDef := $critiquesCategoryDefs -}} + {{- $critiquePath := index $critiqueDef "Path" -}} + {{- $critiqueSection := $site.GetPage $critiquePath -}} + {{- $critiquePages := slice -}} + {{- with $critiqueSection -}} + {{- range .RegularPagesRecursive.ByDate.Reverse -}} + {{- if eq (partial "is-dossier-lead.html" .) "true" -}} + {{- $critiquePages = $critiquePages | append . -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- if gt (len $critiquePages) 0 -}} + {{- $latestDateKey := "00000000000000" -}} + {{- with index $critiquePages 0 -}} + {{- $latestDateKey = .Date.Format "20060102150405" -}} + {{- end -}} + {{- $critiquesCategoryEntries = $critiquesCategoryEntries | append (dict + "Section" $critiqueSection + "Pages" (first 8 $critiquePages) + "LatestDateKey" $latestDateKey + ) -}} + {{- end -}} +{{- end -}} +{{- $critiquesCategoryEntries = sort $critiquesCategoryEntries "LatestDateKey" "desc" -}}
{{- if gt (len $interestsSpotlight) 0 -}} @@ -209,22 +232,9 @@ {{- end -}} - {{- range $critiqueIndex, $critiqueDef := $critiquesCategoryDefs -}} - {{- $critiquePath := index $critiqueDef "Path" -}} - {{- $critiquePrefix := printf "%s/" (strings.TrimSuffix "/" $critiquePath) -}} - {{- $critiqueSection := $site.GetPage $critiquePath -}} - {{- $critiquePool := slice -}} - {{- range $critiquesArticles -}} - {{- if and (strings.Contains .RelPermalink $critiquePrefix) (not (in $critiquesDisplayed .File.Path)) -}} - {{- $critiquePool = $critiquePool | append . -}} - {{- end -}} - {{- end -}} - - {{- $critiqueSpotlight := first 8 $critiquePool -}} - {{- range $critiqueSpotlight -}} - {{- $critiquesDisplayed = $critiquesDisplayed | append .File.Path -}} - {{- end -}} - + {{- range $critiqueIndex, $critiqueEntry := $critiquesCategoryEntries -}} + {{- $critiqueSection := index $critiqueEntry "Section" -}} + {{- $critiqueSpotlight := index $critiqueEntry "Pages" -}} {{- if gt (len $critiqueSpotlight) 0 -}}