feat: Ajout des articles mise en avant
This commit is contained in:
parent
a7abcd5b4c
commit
4ce0a04f96
|
@ -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 }}
|
||||
|
|
|
@ -43,7 +43,7 @@ const config = {
|
|||
},
|
||||
actualites: {
|
||||
readByQueryOption: {
|
||||
fields: ['title', 'date', 'image', 'image_credit', 'vignette', 'vignette_credit', 'description', 'auteur', 'draft', 'content', 'event', 'authors.Association_id.denomination'],
|
||||
fields: ['title', 'date', 'highlight', 'image', 'image_credit', 'vignette', 'vignette_credit', 'description', 'auteur', 'draft', 'content', 'event', 'authors.Association_id.denomination'],
|
||||
filter: filterDraft,
|
||||
limit: 1000
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue