diff --git a/layouts/home.html b/layouts/home.html index 4dacf1b..eec4c9a 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -9,9 +9,14 @@

Le fil des actualités

{{ $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 @@

Le fil des Évènements

{{ $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 }} diff --git a/scripts/directus-to-markdown/index.js b/scripts/directus-to-markdown/index.js index d925e96..e4a55b8 100644 --- a/scripts/directus-to-markdown/index.js +++ b/scripts/directus-to-markdown/index.js @@ -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 },