Implement Root Toggle for multi-root documentation structure#12
Merged
huangyiirene merged 7 commits intomainfrom Jan 18, 2026
Merged
Implement Root Toggle for multi-root documentation structure#12huangyiirene merged 7 commits intomainfrom
huangyiirene merged 7 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
… fix dependencies Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add root toggle for multi-framework navigation
Implement Root Toggle for multi-root documentation structure
Jan 18, 2026
Contributor
|
@copilot 没有看到下拉框的切换效果 |
Copilot stopped work on behalf of
huangyiirene due to an error
January 18, 2026 01:49
Contributor
|
@copilot 继续 |
…own selector Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Contributor
Author
🚀 Preview DeploymentThis pull request will be automatically deployed to Vercel. Preview Links
Build StatusCheck the CI workflow for build status and any errors. Automated preview information for PR #12 |
…ntegration; update pnpm-lock.yaml for lucide-react dependency
🚀 Preview DeploymentThis pull request will be automatically deployed to Vercel. Preview Links
Build StatusCheck the CI workflow for build status and any errors. Automated preview information for PR #12 |
Contributor
|
分拆为guide ,dev 两个 root @copilot |
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.
Enables switching between multiple documentation roots (e.g., Core Engine, Platform) via Fumadocs' native Root Toggle dropdown, following the "configuration as code" philosophy.
Changes
Content Structure
content/docs/to support multiple roots (core/,platform/)core/, added sample Platform documentationConfiguration
docs.site.jsonwithproductsarray for defining documentation rootsSiteConfigTypeScript interface to support products configuration{ "products": [ { "title": "Documentation", "description": "Core documentation engine", "url": "/docs/core", "icon": "FileText" }, { "title": "Platform", "description": "Enterprise platform docs", "url": "/docs/platform", "icon": "Layers" } ] }Source Configuration
source.config.tsto define multipledefineDocs()instancescoreLoader,platformLoader) for independent documentation rootsLayout Integration
app/[lang]/docs/layout.tsxto render Root Toggle dropdown viatabspropprimary/primary-foreground) for consistencyDependencies
lucide-reactfor icon supportcontent/directoryScreenshots
Root Toggle Dropdown:
The dropdown selector appears at the top of the sidebar (below the search bar) and allows users to switch between documentation roots:
Core Documentation:
Platform Documentation:
How It Works
The Root Toggle dropdown uses Fumadocs' native
SidebarTabsDropdowncomponent, which automatically renders when thetabsprop contains multiple items. Users can click the dropdown to see all available documentation roots (with icons and descriptions) and navigate between them. Each root has its own independent page tree and URL structure (/docs/core,/docs/platform).Usage
Add new documentation roots by updating
docs.site.jsonand creating corresponding content directories. No React knowledge required.{ "products": [ { "title": "Your Product", "description": "Product description", "url": "/docs/your-product", "icon": "Package" } ] }Then create
content/docs/your-product/and add it tosource.config.ts.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.