Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate urls with different hreflang prevented in static routes #279

Open
learntheropes opened this issue Dec 5, 2022 · 0 comments
Open

Comments

@learntheropes
Copy link

When used in conjunction with nuxt-i18n module, duplicate urls with different hreflang are prevented in static routes.

Duplicate urls may be necessary when you want to specify a region and a region-independent link

This technique is considered valid and even encouraged here (Tester suggested in Google documentation here)

As an example, this sitemap is impossible to generate:

<loc>https://mydomain.com/en</loc>
<lastmod>2022-12-05T07:28:26.630Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
<xhtml:link rel="alternate" hreflang="en-us" href="https://mydomain.com/en"/>
<xhtml:link rel="alternate" hreflang="pt-br" href="https://mydomain.com/pt"/>
<xhtml:link rel="alternate" hreflang="en" href="https://mydomain.com/en"/>
<xhtml:link rel="alternate" hreflang="pt" href="https://mydomain.com/pt"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://mydomain.com"/>
</url>

The workaround is to exclude all the static routes with the exclude property and include them in the dynamic routes generation with routes property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant