Describe the bug
On the deployed SpatialBench docs, the header language selector's Chinese option leads to a 404. The auto-generated alternate-language links omit the /spatialbench/ base path under which the site is actually served.
To Reproduce
Steps to reproduce the behavior:
- Go to https://sedona.apache.org/spatialbench/
- Click the language selector (translate icon) in the header and choose 中文
- You land on https://sedona.apache.org/zh/ → "Not Found" (HTTP 404)
Expected behavior
The Chinese site should open at https://sedona.apache.org/spatialbench/zh/, which exists and returns HTTP 200. The Chinese build is correctly generated and present in the asf-site branch (zh/index.html and all subpages render fine when visited directly).
Root cause
The mkdocs-static-i18n plugin auto-populates config.extra.alternate, which Material's stock partials/alternate.html renders in docs/overrides/partials/header.html. The generated hreflang links are rooted at the domain instead of the deployment subpath:
- en →
https://sedona.apache.org/ (should be .../spatialbench/)
- zh →
https://sedona.apache.org/zh/ (should be .../spatialbench/zh/)
The English link happens to resolve to an unrelated existing page, while /zh/ 404s. This happens because mkdocs.yml does not set site_url; without it, the plugin builds the alternate URLs as absolute-from-root. (The deployed pages also emit no <link rel="canonical">, which Material only generates when site_url is set — confirming it is unset.)
Suggested fix
Add to mkdocs.yml:
site_url: https://sedona.apache.org/spatialbench/
This corrects the alternate-language links (and also fixes canonical and sitemap URLs). The deploy workflow (packaging.yml) will rebuild and push to asf-site after merging.
Additional context
The Chinese translation content and build are already in place (added in #100); this is purely a URL-generation/config issue in the language switcher links.
Describe the bug
On the deployed SpatialBench docs, the header language selector's Chinese option leads to a 404. The auto-generated alternate-language links omit the
/spatialbench/base path under which the site is actually served.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Chinese site should open at https://sedona.apache.org/spatialbench/zh/, which exists and returns HTTP 200. The Chinese build is correctly generated and present in the
asf-sitebranch (zh/index.htmland all subpages render fine when visited directly).Root cause
The
mkdocs-static-i18nplugin auto-populatesconfig.extra.alternate, which Material's stockpartials/alternate.htmlrenders indocs/overrides/partials/header.html. The generatedhreflanglinks are rooted at the domain instead of the deployment subpath:https://sedona.apache.org/(should be.../spatialbench/)https://sedona.apache.org/zh/(should be.../spatialbench/zh/)The English link happens to resolve to an unrelated existing page, while
/zh/404s. This happens becausemkdocs.ymldoes not setsite_url; without it, the plugin builds the alternate URLs as absolute-from-root. (The deployed pages also emit no<link rel="canonical">, which Material only generates whensite_urlis set — confirming it is unset.)Suggested fix
Add to
mkdocs.yml:This corrects the alternate-language links (and also fixes canonical and sitemap URLs). The deploy workflow (
packaging.yml) will rebuild and push toasf-siteafter merging.Additional context
The Chinese translation content and build are already in place (added in #100); this is purely a URL-generation/config issue in the language switcher links.