Repository navigation
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
I noticed that Google Search Console was not reading the sitemap for my second locale that I deploy to a separate domain. When I opened the sitemap file, I saw that the URLs in the sitemap all pointed to my first locale's domain.
For reference, sitemap is configured as follows, but I don't see any options that would affect this:
sitemap: {
lastmod: 'datetime',
changefreq: null,
priority: null
},
Reproducible demo
No response
Steps to reproduce
To reproduce, have at least two locales and set up the following in docusaurus.config.js
const config = {
...
url: 'https://your-primary-domain.com',
baseUrl: '/',
...
},
i18n: {
defaultLocale: 'locale1',
locales: ['locale1', 'locale2'],
localeConfigs: {
'locale1': {
...
baseUrl: '/',
url: 'https://your-primary-domain.com',
},
'locale2': {
...
baseUrl: '/',
url: 'https://your-secondary-domain.com'
},
},
},
...
Deploying these locales to your-primary-domain.com and your-secondary-domain.com works fine, but if you check the sitemap.xml in your-secondary-domain.com, you will find that each item (a element) lists a URL from your-primary-domain.com
Expected behavior
When deployed to separate domains, locales should have independent sitemaps that include only the pages within that domain.
Actual behavior
The sitemap for the second locale uses the first locale's domain. I assume it is actually using the domain specified outside of the i18n block, but I have to specify some domain there (in the url parameter).
Your environment
Use the feature introduced in 3.9.x where you can deploy locales to separate domains. The rest shouldn't matter.
Self-service
- I'd be willing to fix this bug myself.
Activity