Adding a Root Folder
Learn how to add a new root folder to your documentation
Introduction
Fumadocs allows you to create new root folders in your documentation. This helps you organize your docs into clear sections or categories. This guide will walk you through adding a new root folder step by step.
Steps to Add a New Root Folder
Step 1: Create a New Folder
Create a new folder in the content/docs
directory. You can name it anything; this example uses cli
.
Step 2: Update the meta.json
File
Open the meta.json
file located in the content/docs
directory. Add your new folder name to the pages
array:
Step 3: Update the Homepage
Open page.tsx
in the app/(home)
directory and add a new DocumentationItem
:
Step 4: Update Colors (Optional)
Edit globals.css
in the styles
directory to define colors for your new folder:
Update the base styles to apply the new color:
Step 5: Create meta.json
in the New Folder
Create a meta.json
file in your new cli
folder:
Add the following content to meta.json
:
This file defines the metadata for your new folder, including its title, description, and icon.
Step 6: Create a New Page
Create an index.mdx
page in your new cli
folder:
Add initial content to index.mdx
:
That's it! You've successfully added a new root folder to your documentation. Now, navigate to your docs website to view your new folder and content.