wszymanski
wszymanski
NNuxt
Created by wszymanski on 9/10/2024 in #❓・help
How to make sure hreflangs contain domain?
Google Lighthosue complains about SEO on my Nuxt3 page. The reason being is, they are not absolute URLs. This are the links generated in source:
<link rel="alternate" href="/en" hreflang="en" data-hid="7fcee50">
<link rel="alternate" href="/de-DE" hreflang="de" data-hid="5d718b2">
<link rel="alternate" href="/de-DE" hreflang="de-DE" data-hid="26cc44a">
<link rel="alternate" href="/en-DE" hreflang="en-DE" data-hid="64015ce">
<link rel="alternate" href="/en" hreflang="x-default" data-hid="6527e7a">
<link rel="alternate" href="/en" hreflang="en" data-hid="7fcee50">
<link rel="alternate" href="/de-DE" hreflang="de" data-hid="5d718b2">
<link rel="alternate" href="/de-DE" hreflang="de-DE" data-hid="26cc44a">
<link rel="alternate" href="/en-DE" hreflang="en-DE" data-hid="64015ce">
<link rel="alternate" href="/en" hreflang="x-default" data-hid="6527e7a">
and this is my nuxt.config i18n part:
i18n: {
defaultLocale: 'en',
detectBrowserLanguage: false,
langDir: 'i18n/',
locales: [
{
code: 'en',
iso: 'en',
file: 'en.json',
domain: 'https://www.example.com',
},
{
code: 'de-DE',
iso: 'de-DE',
file: 'de.json',
domain: 'https://www.example.com',
},
{
code: 'en-DE',
iso: 'en-DE',
file: 'en.json',
domain: 'https://www.example.com',
},
],
strategy: 'prefix',
vueI18n: './nuxt-i18n.js',
seo: true,
}
i18n: {
defaultLocale: 'en',
detectBrowserLanguage: false,
langDir: 'i18n/',
locales: [
{
code: 'en',
iso: 'en',
file: 'en.json',
domain: 'https://www.example.com',
},
{
code: 'de-DE',
iso: 'de-DE',
file: 'de.json',
domain: 'https://www.example.com',
},
{
code: 'en-DE',
iso: 'en-DE',
file: 'en.json',
domain: 'https://www.example.com',
},
],
strategy: 'prefix',
vueI18n: './nuxt-i18n.js',
seo: true,
}
15 replies
NNuxt
Created by wszymanski on 9/6/2024 in #❓・help
Nuxt Sitemap module does nothing
hi! I followed https://nuxtseo.com/sitemap/getting-started/installation steps and after viewing /sitemap.xml , I just get redirected to 404 page. I get exactly the same results if I comment the module out in nuxt.config, whether I provide more config sitemaps: { sitemaps: ... } }. All I get is nothing, nothing works. Is there some obvious configuration missing from this documentation page? My versions:

"nuxt": "^3.8.0",
"@nuxtjs/sitemap": "^6.0.1",

"nuxt": "^3.8.0",
"@nuxtjs/sitemap": "^6.0.1",
My nuxt.config:
...
modules: [
'@nuxtjs/i18n',
'@nuxtjs/tailwindcss',
'@nuxtjs/sitemap',
],
site: {
url: 'https://www.example.com',
},
...
...
modules: [
'@nuxtjs/i18n',
'@nuxtjs/tailwindcss',
'@nuxtjs/sitemap',
],
site: {
url: 'https://www.example.com',
},
...
So, when loading my app at localhost:3000/sitemap.xml, I land on localhost:3000/en/sitemap.xml with 404 template. Help me, please.
20 replies
NNuxt
Created by wszymanski on 4/11/2024 in #❓・help
Loading fonts in CSS file, when Nuxt is server with router.base path
Hello! I am using Nuxt 2 in larger set of websites, with router.base property adding a /something suffix to the main domain. Everything seems to work fine, most static files apart from... fonts loaded in CSS. The code example below tries to GET via domain.com/_nuxt, excluding the base path from nuxt.config, thus hitting 404. Anyone came across this issue and knows how to solve? src: url('~assets/fonts/font-light.woff2') format('woff2');
1 replies