Skip to content

[DOCS] Set site_url so language switcher links include the base path#110

Merged
jiayuasu merged 1 commit into
mainfrom
fix-language-switcher-base-path
Jun 11, 2026
Merged

[DOCS] Set site_url so language switcher links include the base path#110
jiayuasu merged 1 commit into
mainfrom
fix-language-switcher-base-path

Conversation

@jiayuasu

Copy link
Copy Markdown
Member

Fixes #109

What changes were proposed in this PR?

Add site_url: https://sedona.apache.org/spatialbench/ to mkdocs.yml.

Without site_url, the mkdocs-static-i18n plugin generates the header language-switcher links rooted at the domain, so the 中文 option pointed to https://sedona.apache.org/zh/ (404) instead of https://sedona.apache.org/spatialbench/zh/. Setting site_url also makes Material emit correct <link rel="canonical"> tags and sitemap URLs.

How was this patch tested?

Built the docs locally with the full plugin stack and inspected the generated HTML:

  • The language switcher now links to /spatialbench/ (English) and /spatialbench/zh/ (中文) on both the English and Chinese pages.
  • Canonical links now appear, pointing at https://sedona.apache.org/spatialbench/ and https://sedona.apache.org/spatialbench/zh/.

Without site_url, mkdocs-static-i18n generates alternate-language
links rooted at the domain, so the 中文 option in the header pointed
to https://sedona.apache.org/zh/ (404) instead of
https://sedona.apache.org/spatialbench/zh/. Setting site_url also
makes Material emit correct canonical and sitemap URLs.

Fixes #109
@jiayuasu jiayuasu merged commit 43a47c3 into main Jun 11, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

Language switcher "中文" link 404s — alternate-language URLs missing /spatialbench/ base path

1 participant