diff --git a/layouts/associations/list.html b/layouts/associations/list.html index 21bc5b9..d4db22a 100644 --- a/layouts/associations/list.html +++ b/layouts/associations/list.html @@ -4,19 +4,5 @@
{{ .Content }}
-
- {{ block "list" . }} - {{ range sort .Pages "Permalink" }} - {{ if .Params.bureau }} - -

{{ .RenderString .Title }}

-
- {{ end }} - {{ end }} - {{ end }} -
-
-

Vous ne retrouvez pas votre association ? Une modification, faute, ou un changement de contact, n'hésitez pas à nous écrire à l'adresse {{ "[com@cremeaux.fr](mailto:com@cremeaux.fr)" | markdownify }}.

-
{{ end }} diff --git a/layouts/home.html b/layouts/home.html index 5e33c9d..70dfa32 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -1,25 +1,48 @@ {{ define "main" }}
-

Le fil des actualités

-
-
- {{ $headless := .Site.GetPage "/actualites/" }} - {{ $lastnews := first 4 (sort $headless.Pages "Date" "desc") }} - {{ $first := index (first 1 $lastnews) 0 }} - {{ $others := after 1 $lastnews }} - {{ with $first }} - {{ .Scratch.Set "big" true }} - {{ partial "article-preview.html" . }} - {{ end }} - {{ range $others }} - {{ partial "article-preview.html" . }} - {{ end }} -

- Voir toutes les actualités -

+

+ Signez la pétition pour sauver la pharmacie de Crémeaux ! Nous avons besoin de votre soutiens ! +

+
+
+ {{ $actualites := sort (.Site.GetPage "/actualites/").Pages "Date" "desc" }} +
+

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 }} + {{ .Scratch.Set "big" true }} + {{ partial "article-preview.html" . }} + {{ end }} + {{ range $others }} + {{ partial "article-preview.html" . }} + {{ end }} +

+ Voir toutes les actualités +

+
+
+

Les Évènements des associations

+ {{ $lastnews := first 4 (where $actualites "Params.event" true) }} + {{ $first := index (first 1 $lastnews) 0 }} + {{ $others := after 1 $lastnews }} + {{ with $first }} + {{ .Scratch.Set "big" true }} + {{ partial "article-preview.html" . }} + {{ end }} + {{ range $others }} + {{ partial "article-preview.html" . }} + {{ end }} +

+ Voir toutes les actualités +

+
-
- {{ .Content }} +
+
+ {{ .Content }} +
diff --git a/layouts/shortcodes/associations.html b/layouts/shortcodes/associations.html new file mode 100644 index 0000000..08c189d --- /dev/null +++ b/layouts/shortcodes/associations.html @@ -0,0 +1,12 @@ +
+ {{ block "list" . }} + {{ range sort .Page.Pages "Permalink" }} + {{ if .Params.bureau }} + +

{{ .RenderString .Title }}

+
+ {{ end }} + {{ end }} + {{ end }} +
+
\ No newline at end of file diff --git a/scripts/directus-to-markdown/index.js b/scripts/directus-to-markdown/index.js index 6cee8e7..5d1a75c 100644 --- a/scripts/directus-to-markdown/index.js +++ b/scripts/directus-to-markdown/index.js @@ -38,7 +38,7 @@ const config = { }, actualites: { readByQueryOption: { - fields: ['title', 'date', 'image', 'image_credit', 'vignette', 'vignette_credit', 'description', 'auteur', 'draft', 'content'], + fields: ['title', 'date', 'image', 'image_credit', 'vignette', 'vignette_credit', 'description', 'auteur', 'draft', 'content', 'event'], filterDraft }, pathBuilder: (article) => {