From 02975190a40d128910623bc56b33c3466b361720 Mon Sep 17 00:00:00 2001 From: Simon C Date: Mon, 12 Dec 2022 10:55:19 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Mise=20=C3=A0=20jour=20de=20l'import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/directus-to-markdown/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/directus-to-markdown/index.js b/scripts/directus-to-markdown/index.js index bedb755..2a67765 100644 --- a/scripts/directus-to-markdown/index.js +++ b/scripts/directus-to-markdown/index.js @@ -1,14 +1,15 @@ import DirectusToMarkdown from '@resilien/directus-to-markdown' import urlslug from 'url-slug' -const filter = process.env.DRAFT && process.env.DRAFT == 'true' ? '' : { draft: { _eq: 'false' } } +const filterDraft = process.env.DRAFT && process.env.DRAFT == 'true' ? '' : { draft: { _eq: 'false' } } +const filterAssociation = process.env.DRAFT && process.env.DRAFT == 'true' ? '' : { display_website: { _eq: 'true' } } const config = { collections: { actualites: { readByQueryOption: { fields: ['title', 'date', 'image', 'image_credit', 'description', 'auteur', 'draft', 'content'], - filter + filterDraft }, pathBuilder: (article) => { const [year, month, day] = article.date.split("-") @@ -28,14 +29,15 @@ const config = { 'bureau.sort', 'bureau.Contact_id.*', 'content', - ] + ], + filterAssociation }, pathBuilder: (association) => { if (!association.title) { association.title = association.denomination } + console.log("Import de l'association « " + association.title + " »") if (association.bureau && association.bureau.length > 0) { - console.log(association.bureau.length) const bureau = [] for (const contact of association.bureau) { const detail = contact.Contact_id