| name | fumadocs-content |
| description | Use when creating, organizing, or updating MDX documentation content in the Fumadocs-based docs system |
Fumadocs Content Management
Overview
Manage MDX documentation content with Fumadocs frontmatter, source configuration, and content organization.
When to Use
- Creating new documentation pages
- Organizing docs into sections/categories
- Adding metadata (title, description, order)
- Referencing content in components
- Setting up navigation
File Structure
MDX files live in .source/ directory. Reference via @/.source alias.
import { defineSource } from 'fumadocs-mdx';
export const source = defineSource({
glob: '**/*.mdx',
root: '.source',
});
Frontmatter Schema
---
title: Page Title
description: SEO description
indexing:
- { category: grammar }
- { category: vocabulary }
weight: 1
---
Key Patterns
Adding New Doc Page
- Create
.source/<section>/<page>.mdx
- Add frontmatter with title, description, indexing
- Use existing MDX components (see
mdx-components.tsx)
- Run
npm run dev to verify
Referencing Content in Components
import { source } from '@/source.config';
const docs = await source.getMany();
const grammarDocs = docs.filter(doc =>
doc.indexing?.some(i => i.category === 'grammar')
);
Using MDX Components
import { Callout } from '@/components/ui/alert';
<Callout type="info">
Important note for learners
</Callout>
Common Mistakes
- Missing frontmatter → page excluded from navigation
- Wrong glob pattern in source.config.ts
- Forgetting
@/.source alias for imports
Quick Reference
| Task | File |
|---|
| Add doc | .source/<name>.mdx |
| Configure source | source.config.ts |
| Custom components | mdx-components.tsx |
| Site config | site.config.ts |