Non-default locale canonical is wrong for dynamic pages due to different paths #1722
Replies: 3 comments 1 reply
-
Maybe for the time being you guys can suggest a workaround to at least prevent the alternate canonicals to be generated? |
Beta Was this translation helpful? Give feedback.
-
@kazupon Thanks for reopening as a discussion. :) |
Beta Was this translation helpful? Give feedback.
-
I'm not sure as I do not use storyblok just nuxt2, but maybe this helps. head () {
const i18nHead = this.$nuxtI18nHead({ addSeoAttributes: true });
return {
...i18nHead,
link: [
...function * () {
for (const lnk of i18nHead.link) {
if (lnk.hid === 'i18n-can') {
yield {
...lnk,
href: this.$store.getters['seo/getCanonicalHref'] || lnk.href,
};
} else {
yield lnk;
}
}
}.bind(this)(),
],
};
} |
Beta Was this translation helpful? Give feedback.
-
We use storyblok as our cms and our pages use different paths per locale. Example:
/datenschutz/
becomes/en/privacy/
But the resulting canonicals say
/datenschutz/
and/en/datenschutz/
, which is a problem.The pages coming from storyblok are not extended to the router for a very similar reason;
extendRoutes()
in nuxt.config cannot be told to have different paths per route (or can it?)What do you guys suggest we should do?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions