Search Documentation

Search for pages and headings in the documentation

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:

  1. Overview (manual, position 1)
  2. Getting Started (manual, position 2)
  3. Advanced… (auto, alphabetical)
  4. Caching… (auto, alphabetical)
  5. 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

  1. Process manual entries first - Add in order specified
  2. Track which slugs are already listed - Avoid duplicates
  3. Scan folder for all files - Find additional files
  4. Filter out already-listed - Exclude manual entries from auto-discovery
  5. Sort remainder alphabetically - Append in sorted order
  6. 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: