When to Use Auto-Generation
Auto-generation is powerful, but itβs not always the right choice. Hereβs when and why to use it.
Ideal Scenarios
1. Growing Documentation
Your docs are expanding and new pages appear frequently.
Example:
Initial setup: 20 pages
Scenario: Team adds 5 new pages per week
Problem: Manual config becomes maintenance burden
Solution: Auto-generation discovers pages automatically
Configuration:
{
id: "guides",
label: "Guides",
autoGenerated: true,
}
Result: New files appear automatically every week, zero manual updates.
2. Large Documentation (100+ pages)
Too many pages to manually list.
Example: API documentation with 50+ endpoints
content/api/
βββ endpoints/
β βββ users/
β β βββ get.md
β β βββ create.md
β β βββ update.md
β β βββ delete.md
β βββ posts/
β β βββ get.md
β β βββ create.md
β β βββ update.md
β ... (20+ more endpoints)
Configuration:
{
id: "endpoints",
label: "Endpoints",
autoGenerated: true,
}
Result: 50+ pages appear automatically, no manual list needed.
3. Alphabetical Ordering is Acceptable
Your content works well alphabetically.
Good:
- API endpoints (A-Z order is fine)
- Feature list (Users donβt care about order)
- Troubleshooting topics (Searchable anyway)
- Reference documentation
Not good:
- Tutorials (Need specific progression)
- Getting started (Must start with basics)
- Conceptual guides (Build on each other)
4. Multiple Contributors
Team members add content independently.
Scenario:
- Alice adds
authentication.md - Bob adds
caching.md - Charlie adds
deployment.md - Nobody updates config file
With auto-generation: All three appear automatically, conflict-free.
With manual entries: Whoever updates last wins; othersβ files get lost.
Scenarios to Avoid Auto-Generation
1. Specific Ordering Required
Alphabetical doesnβt match your content flow.
Example: Tutorial series
Lessons must appear in order:
1. Introduction
2. Installation
3. First Application
4. Advanced Topics
5. Troubleshooting
Alphabetical order would be:
1. Advanced Topics β
2. First Application β
3. Installation β
4. Introduction β
5. Troubleshooting β
Solution: Use manual configuration
{
id: "tutorial",
label: "Tutorial",
entries: [
{ slug: "tutorial/introduction" },
{ slug: "tutorial/installation" },
{ slug: "tutorial/first-app" },
{ slug: "tutorial/advanced" },
{ slug: "tutorial/troubleshooting" },
],
}
2. Carefully Curated Selection
You only want certain files in navigation.
Example: Drafts exist in folder but shouldnβt show
content/guides/
βββ published/
β βββ getting-started.md <- Should appear
β βββ setup.md <- Should appear
βββ drafts/
β βββ wip-new-feature.md <- Shouldn't appear
β βββ coming-soon.md <- Shouldn't appear
Solution: Manual configuration
{
id: "guides",
label: "Guides",
entries: [
{ slug: "guides/published/getting-started" },
{ slug: "guides/published/setup" },
],
}
3. Custom Labels Throughout
Every file needs different navigation label than file name.
Example:
Files:
- api-reference.md (label: "API Reference") β
- sdk-examples.md (label: "SDK Examples") β
- faq-common-issues.md (label: "FAQ") β auto-gen would show "Faq Common Issues"
- troubleshooting.md (label: "Errors & Fixes") β
- performance-tuning.md (label: "Optimization") β
Solution: Manual configuration for custom labels
{
id: "help",
label: "Help",
entries: [
{ slug: "help/api-reference" },
{ slug: "help/faq-common-issues", label: "FAQ" },
{ slug: "help/troubleshooting", label: "Errors & Fixes" },
{ slug: "help/performance-tuning", label: "Optimization" },
],
}
4. Different Audiences
Different documents for different user types.
Example: Developer docs repo
content/
βββ user-guide/
β βββ getting-started.md
β βββ faq.md
β βββ support.md
βββ developer-guide/
β βββ architecture.md
β βββ contributing.md
β βββ build-setup.md
βββ internal/
β βββ roadmap.md
β βββ meeting-notes.md
β βββ TODO.md <- Should NOT appear publicly
Problem: Auto-gen on root would show internal docs
Solution: Manual config or use navHidden: true
Hybrid: The Best of Both
Want auto-discovery + specific ordering?
Use hybrid mode:
{
id: "guides",
label: "Guides",
entries: [
{ slug: "guides/overview" }, // Always first
{ slug: "guides/quick-start" }, // Always second
],
autoGenerated: true, // Rest auto-discovered
}
Result:
- Overview (manual, position 1)
- Quick Start (manual, position 2)
- Advanced (auto, alphabetical)
- Caching (auto, alphabetical)
- Deployment (auto, alphabetical)
See Hybrid Approach for details.
Decision Matrix
| Scenario | Auto-Gen | Manual | Hybrid |
|---|---|---|---|
| Growing docs | β | β | β |
| Large docs | β | β | β |
| Alphabetical OK | β | β | β |
| Multiple contributors | β | β | β |
| Specific order needed | β | β | β |
| Curated selection | β | β | β |
| Custom labels | β | β | β |
| Mixed requirements | β | β | β |
Real-World Pattern
Smart teams use all three:
groups: [
// Auto-generated: High-volume auto-discovering sections
{ id: "features", label: "Features", autoGenerated: true },
{ id: "faq", label: "FAQ", autoGenerated: true },
// Manual: Carefully structured progressive learning
{
id: "getting-started",
label: "Getting Started",
entries: [
{ slug: "getting-started/intro" },
{ slug: "getting-started/install" },
{ slug: "getting-started/first-app" },
],
},
// Hybrid: Best of both
{
id: "guides",
label: "Guides",
entries: [{ slug: "guides/overview" }],
autoGenerated: true,
},
];
Next Steps
Learn about: