feat: Ajout d'une configuration avec les brouillons

This commit is contained in:
Simon 2022-01-29 14:08:44 +01:00
parent abdf3900af
commit b632f0f7a1
1 changed files with 3 additions and 1 deletions

View File

@ -1,13 +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 config = {
contentKey: 'body',
collections: {
actualites: {
readManyOption: {
fields: ['title', 'slug', 'date', 'image', 'image_credit', 'draft', 'body'],
filter: { draft: { _eq: 'false' } }
filter
},
pathBuilder: (article) => {
if (article.slug) {