Разобраться с генерацией мета тегов в приложении на Nuxt.js
7 USDИмеется приложение на Nuxt.js, при генерации проекта при помощи команды npm run generate, по неопределенной причине не генерируются теги title и meta description. Нужен опытный специалист по Nuxt.js который поможет решить данную проблему. Прошу откликаться разработчиков только с реальным опытом работы на Nuxt.js и кто понимает как он работает.
В обсуждении проекта добавил детали.
-
Artur Polyakov TechTide
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 не генерируются следующие мета теги - title и meta description.
nuxt.config.js
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:
head() {
return {
title: ‘xxxxx - Rated #1 in Video Ad Service',
meta: [
{
hid: "description",
name: "description",
content:
“xxxxx”,
},
],
};
},
При генерации в html встраиваются нормально только мета теги связанные с open graph (og:), те которые прописаны в nuxt.config.js. Эксперемента ради, убирал все посторонние библиотеки и пробовал генерировать, на удивление все генерится как нужно.
Также если в nuxt.config прописать статический title, при генерации он встраивается нормально в разметку html
При запуске проекта на сервере title и meta description отрабатывает как нужно, то есть, после загрузки скриптов ставятся нужные теги, но к примеру seo боты не дожидаются загрузгки скриптов и не видят этих тегов
-
Current freelance projects in the category Web Programming
Creation of a website for an accounting firm on WordPress (using a ready-made template)
557 USD
Good day. We are an accounting firm - we want to create a website for the accounting firm on WordPress (using a ready-made template) in two languages. It should be optimized for Google and SEO. Web Programming ∙ 14 hours 3 minutes back ∙ 80 proposals |
Improvement of the time tracking system on ASP.NETNeed a .NET developer for a small project — an employee payroll system. Three tasks: Deploy the system on our subdomain (we will provide the domain and access). Audit the login form + make security improvements if necessary. Implement a closed API for data export in JSON. Stack:… Web Programming ∙ 14 hours 16 minutes back ∙ 27 proposals |
A modern website is needed for a stretch ceiling company in Poland.
635 USD
Need a modern premium design, mobile device adaptation, fast loading, SEO, animations, calculator, portfolio, application form. Experience in creating websites in Poland, landing pages for construction or renovation companies is preferred. Please be sure to send examples of your… HTML & CSS, Web Programming ∙ 16 hours 34 minutes back ∙ 122 proposals |
Looking for a Frontend Developer for an educational platformFrontend Developer https://www.figma.com/design/vXKC6kfWOeDBX2464BXqRv/%D0%A2%D0%97?node-id==0-1&p=f&t=OJxQ9DF0zXBNnBJv-0 Hello! We are looking for a frontend developer to work on a modern music platform Muse. The project already has a ready design in Figma, a… HTML & CSS, Web Programming ∙ 18 hours 22 minutes back ∙ 82 proposals |
Redesign and SEO optimization of the website on the Prom.ua platformTechnical Task Website: protone.com.uaMain Goal The website needs to be made modern, visually appealing, user-friendly, and maximally prepared for promotion in search engines and within the Prom.ua marketplace. The main focus is on improving the design, catalog structure,… Web Programming, Web Design ∙ 18 hours 51 minutes back ∙ 23 proposals |