Closed dargmuesli closed 3 hours ago
After looking into this again, you actually need to set a baseUrl
(see https://i18n.nuxtjs.org/docs/guide/seo) since relative URLs for alternate links are not considered valid (according to Google https://developers.google.com/search/docs/specialty/international/localized-versions#all-method-guidelines).
We should probably add warnings if baseUrl
is unset when using addSeoAttributes
and perhaps disable the tags altogether if unset (in v9, as that would be breaking)
You're right! I was just setting baseUrl
in the runtimeConfig
for $production
, which was a mistake by me. Thank you for looking into this! A warning sounds like a great idea. If you want, you can rename this issue to fit the idea of adding a warning, or close this and create a new issue of course.
Environment
Reproduction
https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-4wdrme?file=app.vue
Describe the bug
Starting with v8.3.1 some trailing slashes disappeared, which leads to these invalid headers when using
useLocaleHead({ addSeoAttributes: true })
:Notice the empty
href
s, which should include/
as they did before.Additional context
No response
Logs
No response