-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Root Toggle for multi-root documentation structure #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 没有看到下拉框的切换效果 |
|
@copilot 继续 |
…own selector Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
🚀 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 |
|
分拆为guide ,dev 两个 root @copilot |
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.