diff --git a/.drone.yml b/.drone.yml index 60e8347..162524f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/.env b/.env index 3de9512..02faf21 100644 --- a/.env +++ b/.env @@ -2,3 +2,4 @@ DOCKER_CONTEXT=vert.weko.resilien NAME=ltdv URL=lestoitsduval.fr STATS_CONTAINER=ltdv-stats +DIRECTUS_URL=https://contenu.${URL} diff --git a/.gitignore b/.gitignore index b45f0b7..87934e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ public resources backups +.hugo_build.lock diff --git a/themes/hugo-theme-directus-import/import.js b/themes/hugo-theme-directus-import/import.js index 74853ce..19c24aa 100644 --- a/themes/hugo-theme-directus-import/import.js +++ b/themes/hugo-theme-directus-import/import.js @@ -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}` diff --git a/themes/hugo-theme-directus-import/index.js b/themes/hugo-theme-directus-import/index.js index 1504a16..a21ed1a 100644 --- a/themes/hugo-theme-directus-import/index.js +++ b/themes/hugo-theme-directus-import/index.js @@ -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){