Hi!
I have an issue with my meta data.
Here, my head function in my single page blog article:
head() {
return {
title: this.page.data.meta_title,
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ name: "format-detection", content: "telephone=no" },
{
hid: "description",
name: "description",
content: this.page.data.meta_description,
},
{ property: "og:type", content: "website" },
{ property: "og:title", content: this.page.data.meta_title },
{ property: "og:url", content: process.env.baseUrl + this.page.url },
{ property: "og:image", content: this.page.data.og_image.url },
{ property: "og:image:type", content: "image/jpg" },
{
property: "og:description",
content: this.page.data.meta_description,
},
],
};
},
In localhost, everything is working fine.
<title>French Tech Weeks</title>
<meta data-n-head="ssr" charset="utf-8">
<meta data-n-head="ssr" name="viewport" content="width=device-width, initial-scale=1">
<meta data-n-head="ssr" name="format-detection" content="telephone=no">
<meta data-n-head="ssr" charset="utf-8">
<meta data-n-head="ssr" name="viewport" content="width=device-width, initial-scale=1">
<meta data-n-head="ssr" name="format-detection" content="telephone=no">
<meta data-n-head="ssr" data-hid="description" name="description" content="French Tech Weeks">
<meta data-n-head="ssr" property="og:type" content="website">
<meta data-n-head="ssr" property="og:title" content="French Tech Weeks">
<meta data-n-head="ssr" property="og:url" content="http://localhost:3000/blog/tech/french-tech-weeks">
<meta data-n-head="ssr" property="og:image" content="https://images.prismic.io/publicom/45b1c7cc-a5d6-4d4c-95b2-6c16c26ae44d_french-tech-weeks.webp?auto=compress,format">
<meta data-n-head="ssr" property="og:image:type" content="image/jpg">
<meta data-n-head="ssr" property="og:description" content="French Tech Weeks">
But after my nuxt build (netlfify, static) , everything is gone
<head>
<title>Publicom</title>
<meta data-n-head="1" charset="utf-8">
<meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1">
<meta data-n-head="1" data-hid="description" name="description" content="">
<meta data-n-head="1" name="format-detection" content="telephone=no">
<link data-n-head="1" rel="icon" type="image/x-icon" href="[/favicon.ico](https://dev.publicom.agency/favicon.ico)">
</head>
This model of meta is what i have in my nuxt.config.js file.
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'Publicom',
htmlAttrs: {
lang: 'fr'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
I use the prispic apiOptions route in this file
prismic: {
endpoint: apiEndpoint,
modern: true,
/* see configuration for more */
apiOptions: {
routes: [
{
type: 'article',
path: '/blog/:category/:uid',
resolvers: {
category: 'category'
}
}
],
},
},
All blog articles are generated correctly, but without meta...
Any ideas?
Thanks a lot !