Ordre des blocs
This commit is contained in:
@@ -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" -}}
|
||||
|
||||
<main class="home-main">
|
||||
{{- if gt (len $interestsSpotlight) 0 -}}
|
||||
@@ -209,22 +232,9 @@
|
||||
</section>
|
||||
{{- 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 -}}
|
||||
<section class="home-critiques-category">
|
||||
<header>
|
||||
|
||||
Reference in New Issue
Block a user