Answer the question
In order to leave comments, you need to log in
Nuxt.js does not generate meta tags. What's wrong?
Nuxt.js
"dependencies": {
"@nuxtjs/axios": "^5.12.5",
"@nuxtjs/robots": "^2.4.2",
"@nuxtjs/sitemap": "^2.4.0",
"aos": "^2.3.4",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"jquery": "^3.5.1",
"marked": "^1.2.7",
"nuxt": "^2.14.0",
"nuxt-purgecss": "^1.0.0",
"vue-friendly-iframe": "^0.19.0",
"vue-lazyload": "^1.3.3",
"vue-owl-carousel": "^2.0.3",
"vue-vimeo-player": "^0.1.1"
},
npm run generate
, the following meta tags are not generated - title and meta description. export default {
head: {
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ hid: "description", name: "description", content: "" },
{
hid: "og:title",
property: "og:title",
content: “xxxxx - Rated #1 in Video Ad Service"
},
{
hid: "og:description",
property: "og:description",
content:
“xxx”
},
{
hid: "og:type",
property: "og:type",
content: "website"
},
{
hid: "og:image",
property: "og:image",
content: "/og-image.png"
},
{
hid: "og:url",
property: "og:url",
content: “xxxxx”
},
{
hid: "og:locale",
property: "og:locale",
content: "en_GB"
}
],
link: [
{ rel: "icon", type: "image/x-icon", href: "/favicon.png" },
{
rel: "stylesheet",
href: "/libs/bootstrap/bootstrap-reboot.min.css"
},
{
rel: "stylesheet",
href: "/libs/bootstrap/bootstrap-grid.min.css"
},
// {
// rel: "stylesheet",
// href: "/libs/owl-carousel/owl.carousel.css"
// },
{
rel: "stylesheet",
href: "/css/main.css"
},
{
rel: "stylesheet",
href: "/css/media.css"
}
],
script: [
{
src: "https://code.jquery.com/jquery-1.11.1.min.js"
},
{
src: "/js/common.js"
},
{
src: "/ga.js"
},
{
src: "/pixel.js"
}
]
},
target: "static",
sitemap: {
hostname: “xxxxxxxxx”,
path: "/sitemap.xml"
},
css: [],
plugins: [
{ src: "~/plugins/lazy", ssr: false },
{ src: "~/plugins/iframe", ssr: false },
{ src: "~/plugins/aos", ssr: false }
],
components: true,
buildModules: [],
modules: ["@nuxtjs/axios", "@nuxtjs/sitemap", "@nuxtjs/robots"],
build: {}
};
head() {
return {
title: ‘xxxxx - Rated #1 in Video Ad Service',
meta: [
{
hid: "description",
name: "description",
content:
“xxxxx”,
},
],
};
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question