diff --git a/nuxt.config.js b/nuxt.config.js index bce7c2981..afc368de9 100755 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -30,7 +30,8 @@ export default { { hid: 'description', name: 'description', - content: process.env.npm_package_description || '', + content: + 'Pix est le service public en ligne pour évaluer, développer et certifier ses compétences numériques tout au long de la vie.', }, ], link: [ diff --git a/services/meta-builder.js b/services/meta-builder.js index a111de2cd..81abdad33 100644 --- a/services/meta-builder.js +++ b/services/meta-builder.js @@ -1,3 +1,6 @@ +export const fallbackDescription = + 'Pix est le service public en ligne pour évaluer, développer et certifier ses compétences numériques tout au long de la vie.' + export default function getMeta(meta, currentPagePath, prismic) { function getTwitterCard() { const twitterMeta = meta.find((meta) => meta.slice_type === 'twitter_card') @@ -39,7 +42,8 @@ export default function getMeta(meta, currentPagePath, prismic) { { hid: 'og:description', property: 'og:description', - content: prismic.asText(ogMeta.primary.description), + content: + prismic.asText(ogMeta.primary.description) || fallbackDescription, }, { hid: 'og:type', property: 'og:type', content: 'article' }, { @@ -65,7 +69,9 @@ export default function getMeta(meta, currentPagePath, prismic) { { hid: 'description', name: 'description', - content: prismic.asText(generalCard.primary.description), + content: + prismic.asText(generalCard.primary.description) || + fallbackDescription, }, ] } diff --git a/tests/pages/pix-site/__snapshots__/index.test.js.snap b/tests/pages/pix-site/__snapshots__/index.test.js.snap index daffa368c..38c3cdebc 100644 --- a/tests/pages/pix-site/__snapshots__/index.test.js.snap +++ b/tests/pages/pix-site/__snapshots__/index.test.js.snap @@ -1,13 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Index Page get the corrects meta 1`] = ` -VueWrapper { - "_emitted": Object {}, - "_emittedByOrder": Array [], - "isFunctionalComponent": undefined, -} -`; - exports[`Index Page renders properly 1`] = ` "