Search Documentation

Search for pages and headings in the documentation

How Auto-Generation Works

Auto-generation is one of CelestialDocs’ most powerful features. Enable it on a group, and files automatically appear in the sidebar without additional configuration.

What is Auto-Generation?

When autoGenerated: true, the system:

  1. Scans the folder matching your group ID (or configured path)
  2. Finds all .md and .mdx files
  3. Creates entries sorted alphabetically
  4. Updates automatically when you add new files

Basic Example

Configuration

{
    id: "features",
    label: "Features",
    autoGenerated: true,  // <- Enable auto-discovery
}

File Structure

content/my-docs/features/
β”œβ”€β”€ auto-generation.md      <- Automatically discovered
β”œβ”€β”€ breadcrumbs.md          <- Automatically discovered
β”œβ”€β”€ icons.md                <- Automatically discovered
└── table-of-contents.md    <- Automatically discovered

Result

Sidebar automatically shows:

Features
β”œβ”€β”€ Auto Generation       (sorted alphabetically)
β”œβ”€β”€ Breadcrumbs
β”œβ”€β”€ Icons
└── Table Of Contents

No configuration needed for each file!

How Labels Are Generated

Filenames are converted to readable labels:

File: auto-generation.md
-> Slug: auto-generation
-> Label: "Auto Generation"  (title-cased, dashes to spaces)

File: rest-api-integration.md
-> Slug: rest-api-integration
-> Label: "Rest Api Integration"  (each word title-cased)

File: FAQ.md
-> Slug: faq
-> Label: "Faq"

Override with frontmatter if needed:

---
title: "Frequently Asked Questions"  <- Used in browser tab
navLabel: "FAQ"                       <- Used in sidebar
---

Folder Path Matching

By default, group ID matches the folder:

// Group ID: "features"
{ id: "features", label: "Features", autoGenerated: true }
// Looks in: content/[collection]/features/

Customize with path:

// Group ID: "help"
// But scan folder: "common-questions"
{
    id: "help",
    label: "Help",
    autoGenerated: true,
    path: "common-questions",
}
// Looks in: content/[collection]/common-questions/

Filtering Files

Auto-generation respects frontmatter flags:

Hide Specific Pages

---
title: "Internal Notes"
navHidden: true  <- Won't appear in sidebar
---

Page is still accessible via direct URL but doesn’t appear in navigation.

Draft Pages

---
title: "Work in Progress"
draft: true  <- Excluded from production build
---

Result

Features
β”œβ”€β”€ Auto Generation
β”œβ”€β”€ Breadcrumbs
β”œβ”€β”€ Icons
β”œβ”€β”€ Table Of Contents
(Internal Notes doesn't appear)

Ordering

Auto-discovered files are sorted alphabetically by filename (case-insensitive):

Files:
β”œβ”€β”€ 01-introduction.md        <- Appears first
β”œβ”€β”€ 02-installation.md        <- Appears second
β”œβ”€β”€ advanced.md               <- Auto-alphabetically ordered
β”œβ”€β”€ breadcrumbs.md
β”œβ”€β”€ configuration.md
β”œβ”€β”€ deployment.md
└── zz-advanced.md           <- Appears last

To control order:

  • Use numeric prefixes: 01-intro.md, 02-install.md
  • Or use manual configuration (see next section)

Auto-Generation with Nested Groups

Auto-discovery works at every level:

{
    id: "documentation",
    label: "Documentation",
    groups: [
        {
            id: "guides",
            label: "Guides",
            autoGenerated: true,  // Scans content/my-docs/documentation/guides/
        },
        {
            id: "api",
            label: "API",
            groups: [
                {
                    id: "endpoints",
                    label: "Endpoints",
                    autoGenerated: true,  // Scans content/my-docs/documentation/api/endpoints/
                },
            ],
        },
    ],
}

Real-World Examples

Documentation Site

{
    id: "docs",
    label: "Documentation",
    autoGenerated: true,
}

Create files, they appear automatically:

content/my-docs/
β”œβ”€β”€ getting-started.md
β”œβ”€β”€ installation.md
β”œβ”€β”€ configuration.md
β”œβ”€β”€ advanced-setup.md

Sidebar shows alphabetically.

Feature List

{
    id: "features",
    label: "Features",
    autoGenerated: true,
}

Add feature docs:

content/my-docs/features/
β”œβ”€β”€ authentication.md
β”œβ”€β”€ caching.md
β”œβ”€β”€ webhooks.md

Updates automatically.

When to Use Auto-Generation

βœ… Good for:

  • Growing documentation
  • Large numbers of pages
  • Frequently changing content
  • Alphabetical ordering acceptable
  • Multiple people contributing

❌ Not ideal for:

  • Specific ordering required
  • Carefully curated selection
  • Hide many files from navigation
  • Need custom labels throughout

Combining with Manual Entries

Use entries + autoGenerated: true for hybrid approach:

{
    id: "guides",
    label: "Guides",
    entries: [
        { slug: "guides/overview" },      // Always first
        { slug: "guides/quick-start" },   // Always second
    ],
    autoGenerated: true,  // Rest auto-discovered
}

See Hybrid Approach for details.

Performance

Auto-generation happens at build time, not runtime. Performance impact is negligible even with 1000+ files.

Troubleshooting

Files not appearing?

  • Check file is in correct folder
  • Verify autoGenerated: true is set
  • Look for navHidden: true in frontmatter
  • Check draft: true in frontmatter

Order is wrong?

  • Use numeric prefixes: 01-, 02-, etc.
  • Or use manual entries for precise control

Label looks wrong?

  • Add navLabel: to frontmatter
  • Or override in manual entries

Next Steps

Learn about: