Skip to content
Snippets Groups Projects
Commit 79a2aa44 authored by Emmanuel Salomon's avatar Emmanuel Salomon :fist:
Browse files

fix: meta tag for home + og image

parent 901748d9
No related branches found
No related tags found
No related merge requests found
...@@ -60,31 +60,46 @@ export function reduceResults(results) { ...@@ -60,31 +60,46 @@ export function reduceResults(results) {
* @return {Object} An object with meta good for SEO :) * @return {Object} An object with meta good for SEO :)
*/ */
export function headDocument() { 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 { return {
title: this.document.title, title,
meta: [ meta: [
{ {
hid: 'description', hid: 'description',
name: 'description', name: 'description',
content: this.document.description, content,
}, },
// Open Graph // Open Graph
{ hid: 'og:title', property: 'og:title', content: this.document.title }, { hid: 'og:title', property: 'og:title', content: title },
{ {
hid: 'og:description', hid: 'og:description',
property: 'og:description', property: 'og:description',
content: this.document.description, content,
},
{
hid: 'og:image',
property: 'og:image',
content: image,
}, },
// Twitter Card // Twitter Card
{ {
hid: 'twitter:title', hid: 'twitter:title',
name: 'twitter:title', name: 'twitter:title',
content: this.document.title, content: title,
}, },
{ {
hid: 'twitter:description', hid: 'twitter:description',
name: 'twitter:description', name: 'twitter:description',
content: this.document.description, content,
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: image,
}, },
], ],
} }
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
</template> </template>
<script> <script>
import { headDocument as head } from '~/libs/helpers'
export default { export default {
name: 'HomePage', name: 'HomePage',
async asyncData({ $content }) { async asyncData({ $content }) {
...@@ -55,6 +57,15 @@ export default { ...@@ -55,6 +57,15 @@ export default {
sections, sections,
} }
}, },
data() {
return {
// for head meta tags
document: {
title: "Repenser la création monétaire...et l'expérimenter !",
},
}
},
head,
} }
</script> </script>
......
static/img/og-home.jpeg

145 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment