Skip to content

fix(core): use locale url in site config#12054

Merged
slorber merged 2 commits into
facebook:mainfrom
rohan-patnaik:fix-locale-site-url
May 22, 2026
Merged

fix(core): use locale url in site config#12054
slorber merged 2 commits into
facebook:mainfrom
rohan-patnaik:fix-locale-site-url

Conversation

@rohan-patnaik
Copy link
Copy Markdown
Contributor

@rohan-patnaik rohan-patnaik commented May 22, 2026

Fixes #12013

Summary

This copies the active locale URL into siteConfig when loading a localized site.

Why

Docusaurus already applies the locale-specific baseUrl, but kept the top-level url. Plugins that receive siteConfig, including the sitemap plugin, could therefore generate URLs with the primary locale's domain even when the current locale is configured for a separate domain.

Test plan

  • nvm use 26 && yarn oxfmt --list-different packages/docusaurus/src/server/site.ts packages/docusaurus/src/server/__tests__/site.test.ts
  • nvm use 26 && yarn eslint --cache --report-unused-disable-directives packages/docusaurus/src/server/site.ts packages/docusaurus/src/server/__tests__/site.test.ts
  • nvm use 26 && yarn test packages/docusaurus/src/server/__tests__/site.test.ts currently blocked locally because this checkout needs additional built workspace packages (@docusaurus/bundler, then @docusaurus/faster/@docusaurus/babel) after installing dependencies with scripts disabled.

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label May 22, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit aa61727
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a1017737478dd00086c6c21
😎 Deploy Preview https://deploy-preview-12054--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rohan-patnaik rohan-patnaik marked this pull request as ready for review May 22, 2026 08:35
@slorber slorber added pr: bug fix This PR fixes a bug in a past release. to backport This PR is planned to be backported to a stable version of Docusaurus labels May 22, 2026
Copy link
Copy Markdown
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Thanks

Although our e2e tests do not cover this well, I tested it locally and it seems like a reasonable thing to do

@slorber slorber merged commit de96152 into facebook:main May 22, 2026
36 of 37 checks passed
@rohan-patnaik
Copy link
Copy Markdown
Contributor Author

Thanks for the review.
Appreciate the quick merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release. to backport This PR is planned to be backported to a stable version of Docusaurus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When deploying locales to separate domains, URLs in the sitemap do not use the specified domain

2 participants