feat: Ajout des articles mise en avant
This commit is contained in:
@ -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 }}
|
||||
|
Reference in New Issue
Block a user