Repository navigation
docs(sphinx): sidebar language switcher, default to English - #519
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Sphinx/Furo documentation UX by redirecting the root docs page to English, moving the language switcher into the left sidebar, and adjusting custom CSS to properly support dark mode hero styling.
Changes:
- Replace the root landing language-picker page with an immediate redirect to
/en/index.html. - Add a custom Furo sidebar layout that inserts a new sidebar language switcher template.
- Update custom CSS to fix dark-mode hero gradients and style the new sidebar language dropdown.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| docs/sphinx/source/index.md | Replaces the root landing content with an English redirect and updates the root toctree. |
| docs/sphinx/source/conf.py | Configures Furo sidebars to include a new sidebar language switcher component. |
| docs/sphinx/source/_templates/sidebar/lang_switcher.html | Adds a sidebar language switcher template and client-side navigation logic. |
| docs/sphinx/source/_static/css/custom.css | Switches dark-mode hero styling to CSS-variable overrides and adds sidebar switcher styling + hides old switchers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }()); | ||
| </script> | ||
| <meta http-equiv="refresh" content="0; url=en/index.html" /> | ||
| <script>window.location.href = "en/index.html";</script> |
Comment on lines
14
to
19
| ```{toctree} | ||
| :hidden: | ||
| :caption: Languages | ||
|
|
||
| en/index | ||
| zh_CN/index | ||
| ``` | ||
|
|
||
| ```{toctree} | ||
| :hidden: | ||
| :caption: Shared | ||
|
|
||
| adr/README |
| if (!sel) return; | ||
| sel.addEventListener("change", function(){ | ||
| var url = this.value; | ||
| if (url) window.location.href = new URL(url, window.location.href).href; |
Comment on lines
+4
to
+6
| {%- set zh_target = language_switcher_targets.get("zh_CN", "zh_CN/index") if language_switcher_targets is defined else "zh_CN/index" -%} | ||
| <div class="sidebar-lang-switcher"> | ||
| <select class="sidebar-lang-switcher__select" aria-label="Language"> |
Comment on lines
+201
to
+210
| html_sidebars = { | ||
| "**": [ | ||
| "sidebar/brand.html", | ||
| "sidebar/lang_switcher.html", | ||
| "sidebar/search.html", | ||
| "sidebar/scroll-start.html", | ||
| "sidebar/navigation.html", | ||
| "sidebar/scroll-end.html", | ||
| ], | ||
| } |
| :root { | ||
| --ul-hero-bg: linear-gradient(135deg, #eff6ff 0%, #ede9fe 50%, #fef3c7 100%); | ||
| --ul-hero-border: rgba(99, 102, 241, 0.18); | ||
| --ul-hero-text-shadow: none; |
UI changes: - Root index.md now auto-redirects to /en/index.html (no language picker landing page) - Language dropdown moved from page body to left sidebar, below the site title and above the search box - Sidebar navigation only shows English docs; zh_CN pages are still built but accessed exclusively via the language switcher - Add _templates/sidebar/lang_switcher.html for Furo sidebar injection - Configure html_sidebars in conf.py to include the new component Dark theme fix: - Landing hero background was showing light gradient in dark mode because the old selector (body.dark) doesn't match Furo's actual dark-mode mechanism (body[data-theme="dark"] + prefers-color-scheme media query for auto mode) - Now uses CSS custom properties that update in both explicit-dark and auto-dark scenarios - Hero h1 gradient text also gets a lighter palette in dark mode for proper contrast against the dark background Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
caozx1110
force-pushed
the
docs/sphinx-migration
branch
from
May 28, 2026 09:11
8789bc3 to
2556119
Compare
TATP-233
approved these changes
May 28, 2026
TATP-233
added a commit
that referenced
this pull request
May 30, 2026
docs(sphinx): sidebar language switcher, default to English
TATP-233
added a commit
that referenced
this pull request
May 30, 2026
docs(sphinx): sidebar language switcher, default to English
TATP-233
added a commit
that referenced
this pull request
Sep 4, 2026
docs(sphinx): sidebar language switcher, default to English
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code