diff --git a/libs/helpers.js b/libs/helpers.js index 6d4311672067d1b242d643f209588bab968e317c..88dfb52bc777ad0fae0f40f83bf527fdb8e176f7 100644 --- a/libs/helpers.js +++ b/libs/helpers.js @@ -60,31 +60,46 @@ export function reduceResults(results) { * @return {Object} An object with meta good for SEO :) */ export function headDocument() { + const title = this.document.title || this.$config.site_title + const content = this.document.description || this.$config.site_description + const image = + this.document.image || `${this.$config.site_url}/img/og-home.jpeg` + return { - title: this.document.title, + title, meta: [ { hid: 'description', name: 'description', - content: this.document.description, + content, }, // Open Graph - { hid: 'og:title', property: 'og:title', content: this.document.title }, + { hid: 'og:title', property: 'og:title', content: title }, { hid: 'og:description', property: 'og:description', - content: this.document.description, + content, + }, + { + hid: 'og:image', + property: 'og:image', + content: image, }, // Twitter Card { hid: 'twitter:title', name: 'twitter:title', - content: this.document.title, + content: title, }, { hid: 'twitter:description', name: 'twitter:description', - content: this.document.description, + content, + }, + { + hid: 'twitter:image', + name: 'twitter:image', + content: image, }, ], } diff --git a/pages/index.vue b/pages/index.vue index 4a4cdb14f63882e82288bb2f8c557b3e5139bc82..f812ed75b715e0a9b447eac2dc37bb4f89f20855 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -42,6 +42,8 @@ </template> <script> +import { headDocument as head } from '~/libs/helpers' + export default { name: 'HomePage', async asyncData({ $content }) { @@ -55,6 +57,15 @@ export default { sections, } }, + data() { + return { + // for head meta tags + document: { + title: "Repenser la création monétaire...et l'expérimenter !", + }, + } + }, + head, } </script> diff --git a/static/img/og-home.jpeg b/static/img/og-home.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..dd7dc1cec461d864e7f0187fb915470bc540245b Binary files /dev/null and b/static/img/og-home.jpeg differ