Make Version Selector Visible on Mobile Docs#6533
Open
sahil5206 wants to merge 1 commit intopipe-cd:masterfrom
Open
Make Version Selector Visible on Mobile Docs#6533sahil5206 wants to merge 1 commit intopipe-cd:masterfrom
sahil5206 wants to merge 1 commit intopipe-cd:masterfrom
Conversation
Signed-off-by: sahil gupta <Sahilg5206official@gmail.com>
3945795 to
97841af
Compare
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.
What was wrong?
After PR #6480, mobile users couldn't switch documentation versions. The version selector was only visible on desktop, so mobile users were stuck on v1.
Why it happened
The version selector in the navbar used Bootstrap classes that hide it on small screens. Mobile navigation uses the sidebar, which didn't include the version selector.
What I did
Added the version selector to the sidebar for mobile users, following the same pattern as the language selector.
Updated the JavaScript to work with both the navbar (desktop) and sidebar (mobile) selectors.
Result
Desktop: Version selector in the navbar (unchanged)
Mobile: Version selector in the sidebar menu (new)
Mobile users can now switch documentation versions.
Files changed
docs/layouts/partials/sidebar-tree.html - Added version selector to sidebar
docs/assets/js/navbar-version-selector.js - Updated to support multiple selectors
How to test
Run the site locally: make run/site
Open any docs page in mobile view (<992px width)
Open the sidebar menu
You should see the version selector at the top of the sidebar
Click it to verify the dropdown works