feat(Directus): Mise à jour des paramètres de Directus

This commit is contained in:
Simon 2021-12-31 15:32:31 +01:00
parent 4275fed4f3
commit 8d6c4b429f
5 changed files with 8 additions and 9 deletions

View File

@ -20,20 +20,20 @@ data: NsJ77R/8TEmyCM7h6OXkOeGhKAdctofukKezjfjIMGaBv5aGYN4CKYCIBlLsBWfFvMb+0SIDqr
# drone encrypt weko/lestoitsduval $DIRECTUS_URL
kind: secret
name: DIRECTUS_URL
data: pPaOgtpSRFhEZ6zq61OoN+gYxZ6nzg+FlmFYEhUq/GLoFXTwA3i+Yci7ZrwJUmhOpLtG
data: 8yxEqiZv9pFrjT9kS7kMkuG3M0ezKsWf8EVrYqc2U5MpE1iVBOwj87DXJ4UVWZ5t7INKpDmxi2Nk6mXM
---
# drone encrypt weko/lestoitsduval $DIRECTUS_EMAIL
kind: secret
name: DIRECTUS_EMAIL
data: Egj2gQqz40mbxx9tFc7bfTOiUc36Dch+2Y4RjVEt9qpoL1y5d5KEpSE=
data: L+dV9HpRrUTjv7/CI2LHPJr8X2778GoHLswMNUamNMqiAgbQGr6agdU=
---
# drone encrypt weko/lestoitsduval $DIRECTUS_PASSWORD
kind: secret
name: DIRECTUS_PASSWORD
data: TC0fUdQ7NvL7Qri7SuqTK6JC9zbX0xVSyndHl/zbFlecARlc7Yzru65OO1fvf1VQxSejIVlPcyorZRiHepUeTnt0nEXTgDmO
data: h5KEej5axDgJgrP9CSmtoA8gyScxGU2oSInrFon5fCuzFdJYDUtJIiNSKXJspwztaOZ+VaF4aq4KoX9KYuq6Zp2rsPJlFkZc
---
kind: pipeline

1
.env
View File

@ -2,3 +2,4 @@ DOCKER_CONTEXT=vert.weko.resilien
NAME=ltdv
URL=lestoitsduval.fr
STATS_CONTAINER=ltdv-stats
DIRECTUS_URL=https://contenu.${URL}

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
public
resources
backups
.hugo_build.lock

View File

@ -6,7 +6,7 @@ const driverOptions = {
password: process.env.DIRECTUS_PASSWORD,
buildDrafts: false,
collections: {
'lestoitsduval_actualites': {
'actualites': {
pathBuilder: (path, article, urlslug) => {
if (article.slug) {
return `${path}/actualites/${article.slug}`

View File

@ -90,13 +90,8 @@ class Driver {
if (this._isBranch(article, collection) || this._isPage(article, collection)){
return `${this.content.path}/${collection.collection}`;
}
// console.log(article.date)
const datePrefix = article.date_created ? `${article.date_created.split('T')[0]}_` : '';
const [year, mouth, day] = article.date.split('-')
// console.log(year)
// return `${this.content.path}/${collection.collection}/${article.id}_${datePrefix}${urlslug(article.title, { remove: /\./g })}`;
return `${this.content.path}/actualites/${year}/${mouth}/${article.date.replaceAll('-', '_')}-${urlslug(article.title, { remove: /\./g })}`;
}
@ -118,7 +113,9 @@ class Driver {
// Manipulate some variable property names
if (front.date_created){
if (!front.date) {
front.date = front.date_created
}
delete front.date_created
}
if (front.date_updated){