feat: Ajout des articles mise en avant
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2025-03-25 10:56:53 +01:00
parent a7abcd5b4c
commit 4ce0a04f96
2 changed files with 17 additions and 7 deletions

View File

@ -9,9 +9,14 @@
<div class="news viemunicipale">
<h1>Le fil des <strong>actualités</strong></h1>
{{ $lastnews := first 4 (where $actualites "Params.event" false) }}
{{ $first := index (first 1 $lastnews) 0 }}
{{ $others := after 1 $lastnews }}
{{ with $first }}
{{ $highlight := first 1 (where $lastnews "Params.highlight" true) }}
{{ if gt (len $highlight) 0 }}
{{ $highlight = index $highlight 0 }}
{{ else }}
{{ $highlight = index $lastnews 0 }}
{{ end }}
{{ $others := where $lastnews "Title" "ne" $highlight.Title }}
{{ with $highlight }}
{{ .Scratch.Set "big" true }}
{{ partial "article-preview.html" . }}
{{ end }}
@ -25,9 +30,14 @@
<div class="news associations">
<h2 class="h1">Le fil des <strong>Évènements</strong></h2>
{{ $lastnews := first 4 (where $actualites "Params.event" true) }}
{{ $first := index (first 1 $lastnews) 0 }}
{{ $others := after 1 $lastnews }}
{{ with $first }}
{{ $highlight := first 1 (where $lastnews "Params.highlight" true) }}
{{ if gt (len $highlight) 0 }}
{{ $highlight = index $highlight 0 }}
{{ else }}
{{ $highlight = index $lastnews 0 }}
{{ end }}
{{ $others := where $lastnews "Title" "ne" $highlight.Title }}
{{ with $highlight }}
{{ .Scratch.Set "big" true }}
{{ partial "article-preview.html" . }}
{{ end }}