jiayuasu opened a new pull request, #2936:
URL: https://github.com/apache/sedona/pull/2936

   ## Did you read the Contributor Guide?
   
   - Yes, I have read the [Contributor 
Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor 
Development Guide](https://sedona.apache.org/latest/community/develop/)
   
   ## Is this PR related to a ticket?
   
   - Yes, and the PR name follows the format `[GH-XXX] my subject`. Bug fix on 
EPIC #2867 — the 文A language switcher introduced earlier in the EPIC drops the 
active mike version when clicked.
   
   ## What changes were proposed in this PR?
   
   The 文A header switcher built links from `alt.link | url` where `alt.link` is 
set by mkdocs-static-i18n to a server-absolute path like `/zh/sedonaspark/`. 
mkdocs's `| url` filter passes leading-slash paths through unchanged, so on a 
mike-deployed site the link bypasses the version prefix entirely:
   
   - Reproducer: visit https://sedona.apache.org/latest-snapshot/ and click 中文.
   - Expected: navigate to `https://sedona.apache.org/latest-snapshot/zh/`.
   - Actual: navigate to `https://sedona.apache.org/zh/`, which falls outside 
the `latest-snapshot` mike version (404 in our case).
   
   Strip the leading slash before passing to `| url`. mkdocs then treats the 
path as relative to the docs root and computes a page-relative URL that stays 
inside the current mike version. The active locale's `--active` highlight is 
unaffected since that's still keyed off `config.theme.language`.
   
   ## How was this patch tested?
   
   Built the docs locally with `npx --prefix docs-overrides gulp build && uv 
sync --group docs && uv run mkdocs build` and inspected the rendered `<a href>` 
for both locales:
   
   | current page | English link | Chinese link |
   |---|---|---|
   | `/index.html` | `.` | `zh/` |
   | `/sedonaspark/index.html` | `./` | `../zh/sedonaspark/` |
   | `/zh/index.html` | `..` | `./` |
   | `/zh/sedonaspark/index.html` | `../../sedonaspark/` | `./` |
   
   All four cases produce relative paths. Under any mike version prefix (e.g. 
`/latest-snapshot/...`) the relative paths resolve correctly within that 
version.
   
   ## Did this PR include necessary documentation updates?
   
   - No, this PR does not affect any public API so no need to change the 
documentation.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to