You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ji...@apache.org on 2026/05/11 19:08:08 UTC
(sedona) 09/12: [GH-2867] Make language switcher respect mike version prefix (#2936)
This is an automated email from the ASF dual-hosted git repository.
jiayuasu pushed a commit to branch branch-1.9.0
in repository https://gitbox.apache.org/repos/asf/sedona.git
commit d1337ff86f31add964b57a68ce6813b5a5fc48cc
Author: Jia Yu <ji...@apache.org>
AuthorDate: Fri May 8 11:21:40 2026 -0700
[GH-2867] Make language switcher respect mike version prefix (#2936)
(cherry picked from commit d4a604a8fa6e9ba616fec546e4455bd13e3bf612)
---
docs-overrides/partials/alternate.html | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/docs-overrides/partials/alternate.html b/docs-overrides/partials/alternate.html
index 513dcb4f9c..0056fe9e2c 100644
--- a/docs-overrides/partials/alternate.html
+++ b/docs-overrides/partials/alternate.html
@@ -4,11 +4,20 @@
<span class="sd-lang-switch__glyph" aria-hidden="true"><span class="sd-lang-switch__glyph-cn">文</span><span class="sd-lang-switch__glyph-en">A</span></span>
</summary>
<ul class="sd-lang-switch__menu">
+ {#-
+ mkdocs-static-i18n stores `alt.link` as a server-absolute path like
+ `/zh/sedonaspark/`. Passing that directly to `| url` keeps the leading
+ slash, so the link bypasses any deployment prefix added by mike (e.g.
+ `/latest-snapshot/`) and lands at the wrong version. Strip the leading
+ slash so `| url` resolves against the docs root and stays inside the
+ current mike version.
+ -#}
{% for alt in config.extra.alternate %}
{%- set is_active = (alt.lang == config.theme.language) -%}
+ {%- set alt_link = alt.link[1:] if alt.link.startswith('/') else alt.link -%}
<li>
<a
- href="{{ alt.link | url }}"
+ href="{{ alt_link | url }}"
hreflang="{{ alt.lang }}"
lang="{{ alt.lang }}"
target="_self"