You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2026/06/11 07:32:26 UTC

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

jiayuasu opened a new issue, #109:
URL: https://github.com/apache/sedona-spatialbench/issues/109

   **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:
   1. Go to https://sedona.apache.org/spatialbench/
   2. Click the language selector (translate icon) in the header and choose 中文
   3. 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`:
   ```yaml
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Language switcher "中文" link 404s — alternate-language URLs missing /spatialbench/ base path [sedona-spatialbench]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu closed issue #109: Language switcher "中文" link 404s — alternate-language URLs missing /spatialbench/ base path
URL: https://github.com/apache/sedona-spatialbench/issues/109


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org