Hybrid Approach: Best of Both Worlds
The hybrid approach is a game-changer. Pin important entries first, then auto-discover the rest. Get convenience without sacrificing control.
What is the Hybrid Approach?
Combine entries (manual) + autoGenerated: true (auto-discovery):
{
id: "guides",
label: "Guides",
entries: [
{ slug: "guides/overview" }, // Manual: Always first
{ slug: "guides/getting-started" }, // Manual: Always second
],
autoGenerated: true, // Auto-discover rest
}
Result:
- Overview (manual, position 1)
- Getting Started (manual, position 2)
- Advanced⦠(auto, alphabetical)
- Caching⦠(auto, alphabetical)
- Deployment⦠(auto, alphabetical)
The Problem It Solves
Manual only: New pages require config update
// Without hybrid, need to edit config for each new page
entries: [
{ slug: "guides/overview" },
{ slug: "guides/getting-started" },
{ slug: "guides/advanced-setup" }, // <- New file, must add here
{ slug: "guides/troubleshooting" }, // <- New file, must add here
];
Auto-gen only: Canβt control order
// Auto-generation is alphabetical, can't pin important pages first
{
autoGenerated: true;
}
// Result: Advanced (1st), Getting Started (2nd), Overview (3rd) β
Hybrid: Best of both
{
entries: [
{ slug: "guides/overview" }, // Always first
{ slug: "guides/getting-started" }, // Always second
],
autoGenerated: true, // New pages appear automatically
}
// Result: Overview (1), Getting Started (2), Advanced (3), Caching (4)... β
Example 1: Documentation Hub
Scenario
You have a growing documentation site. Important overview always first, rest auto-discovered.
Setup
{
id: "documentation",
label: "Documentation",
entries: [
{
slug: "documentation/overview",
label: "π Overview",
icon: "π"
},
{
slug: "documentation/getting-started",
label: "π Quick Start",
icon: "β‘"
},
],
autoGenerated: true,
}
File Structure
content/docs/documentation/
βββ overview.md
βββ getting-started.md
βββ advanced-setup.md (auto)
βββ caching-strategies.md (auto)
βββ deployment-guide.md (auto)
βββ faq.md (auto)
Result
π Documentation
βββ π Overview (manual)
βββ β‘ Quick Start (manual)
βββ Advanced Setup (auto, alphabetical)
βββ Caching Strategies (auto)
βββ Deployment Guide (auto)
βββ FAQ (auto)
Key: User sees important pages first, but new content appears automatically!
Example 2: Growing Feature List
Scenario
API with many endpoints. Show popular endpoints manually, rest auto-discovered.
Setup
{
id: "endpoints",
label: "Endpoints",
entries: [
{ slug: "api/endpoints/authentication", label: "π Authentication" },
{ slug: "api/endpoints/users", label: "π₯ Users" },
{ slug: "api/endpoints/posts", label: "π Posts" },
],
autoGenerated: true, // Other endpoints auto-discovered
}
File Structure
content/api/endpoints/
βββ authentication.md (manual)
βββ users.md (manual)
βββ posts.md (manual)
βββ comments.md (auto)
βββ notifications.md (auto)
βββ webhooks.md (auto)
Result
π‘ Endpoints
βββ π Authentication (manual)
βββ π₯ Users (manual)
βββ π Posts (manual)
βββ Comments (auto)
βββ Notifications (auto)
βββ Webhooks (auto)
Key: Popular endpoints highlighted at top, new endpoints appear automatically!
Example 3: Tutorial + Reference
Scenario
Tutorial series (order matters) + growing reference section (alphabetical OK).
Setup
{
id: "learning",
label: "Learning Guide",
entries: [
// Tutorial chapters - order matters!
{ slug: "learning/01-intro", label: "Introduction" },
{ slug: "learning/02-setup", label: "Setup" },
{ slug: "learning/03-hello-world", label: "Hello World" },
{ slug: "learning/04-variables", label: "Variables" },
{ slug: "learning/05-functions", label: "Functions" },
],
autoGenerated: true, // Reference pages discovered automatically
}
File Structure
content/learning/
βββ 01-intro.md (manual, chap 1)
βββ 02-setup.md (manual, chap 2)
βββ 03-hello-world.md (manual, chap 3)
βββ 04-variables.md (manual, chap 4)
βββ 05-functions.md (manual, chap 5)
βββ api-reference.md (auto)
βββ best-practices.md (auto)
βββ common-patterns.md (auto)
Result
π Learning Guide
βββ Introduction (manual)
βββ Setup (manual)
βββ Hello World (manual)
βββ Variables (manual)
βββ Functions (manual)
βββ Api Reference (auto)
βββ Best Practices (auto)
βββ Common Patterns (auto)
Key: Tutorial flows logically, reference grows without intervention!
Example 4: Scaling Over Time
Month 1 (Initial Setup)
{
id: "guides",
label: "Guides",
entries: [
{ slug: "guides/overview" },
{ slug: "guides/quick-start" },
],
autoGenerated: true,
}
Files: overview.md, quick-start.md
Result:
Guides
βββ Overview
βββ Quick Start
Month 3 (Growing)
// No config change!
{
id: "guides",
label: "Guides",
entries: [
{ slug: "guides/overview" },
{ slug: "guides/quick-start" },
],
autoGenerated: true,
}
Files:
βββ overview.md
βββ quick-start.md
βββ advanced-setup.md
βββ caching.md
βββ deployment.md
Result:
Guides
βββ Overview (manual)
βββ Quick Start (manual)
βββ Advanced Setup (auto)
βββ Caching (auto)
βββ Deployment (auto)
Month 6 (Mature)
// Still no config change!
{
id: "guides",
label: "Guides",
entries: [
{ slug: "guides/overview" },
{ slug: "guides/quick-start" },
],
autoGenerated: true,
}
Files: 15+ files
Result:
Guides
βββ Overview (manual)
βββ Quick Start (manual)
βββ Advanced...
βββ Architecture...
βββ API Reference...
βββ Best Practices...
βββ Caching...
βββ Deployment...
βββ Docker Setup...
βββ Error Handling...
βββ FAQ...
βββ Performance...
βββ Security...
βββ Testing...
βββ Troubleshooting...
Key: Same config, but docs grew 15x!
Implementation Steps
1. Identify Key Pages
Which pages should always appear first?
Example: βOverview and Quick Start are essentialβ
2. Add Manual Entries
entries: [
{ slug: "guides/overview" },
{ slug: "guides/quick-start" },
],
3. Enable Auto-Generation
autoGenerated: true,
4. Organize Files
Put manual pages in folder, rest will auto-discover.
How It Works Internally
- Process manual entries first - Add in order specified
- Track which slugs are already listed - Avoid duplicates
- Scan folder for all files - Find additional files
- Filter out already-listed - Exclude manual entries from auto-discovery
- Sort remainder alphabetically - Append in sorted order
- Combine - Manual first, then auto-discovered
Best Practices
1. Use for Essential Guides
entries: [
{ slug: "guides/getting-started" }, // Always first
{ slug: "guides/core-concepts" }, // Always second
],
autoGenerated: true,
2. Avoid Duplication
// DON'T: List something in entries AND have autoGenerated
// The system handles duplicates, but it's clearer if you don't
entries: [
{ slug: "guides/overview" }, // Manual
],
autoGenerated: true, // Rest auto-discovered (excludes overview)
3. Combine with Icons
entries: [
{ slug: "guides/overview", icon: "π", label: "Overview" },
{ slug: "guides/quick-start", icon: "π", label: "Quick Start" },
],
autoGenerated: true,
4. Use for Navigation Hinting
entries: [
// Suggest the two best starting points
{ slug: "docs/getting-started" },
{ slug: "docs/first-project" },
],
autoGenerated: true, // Everything else is fair game
Limitations
- Manual entries must exist in file system
- Duplicates are handled (but wasteful to list twice)
- Alphabetical ordering used for auto-discovered files (canβt customize)
When to Use Hybrid
β Perfect for:
- Growing documentation
- Pin important pages + expand
- Tutorial + reference mix
- Multiple audiences (pin first useful page)
- Learning guides (structured start + reference)
β Not ideal for:
- All pages need custom ordering
- Very small docs (just use manual)
- Very large docs with no clear priorities
Next Steps
Learn more: