Auto-Generation Examples
Real-world examples showing auto-generation in action.
Example 1: Simple Feature List
Setup
{
id: "features",
label: "Features",
autoGenerated: true,
}
Files
content/my-docs/features/
βββ authentication.md
βββ breadcrumbs.md
βββ dark-mode.md
βββ export-data.md
βββ icons.md
Result
β¨ Features
βββ Authentication
βββ Breadcrumbs
βββ Dark Mode
βββ Export Data
βββ Icons
(Alphabetical order)
Example 2: Large API Reference
Setup
{
id: "endpoints",
label: "Endpoints",
groups: [
{ id: "users", label: "Users", autoGenerated: true },
{ id: "posts", label: "Posts", autoGenerated: true },
{ id: "comments", label: "Comments", autoGenerated: true },
],
}
Files
content/api/endpoints/users/
βββ create.md
βββ delete.md
βββ get-by-id.md
βββ list.md
βββ update.md
content/api/endpoints/posts/
βββ create.md
βββ delete.md
βββ list.md
βββ update.md
content/api/endpoints/comments/
βββ create.md
βββ list.md
Result
π‘ API Reference
βββ Comments
β βββ Create
β βββ List
βββ Posts
β βββ Create
β βββ Delete
β βββ List
β βββ Update
βββ Users
βββ Create
βββ Delete
βββ Get By Id
βββ List
βββ Update
Example 3: Numeric Ordering
Setup
{
id: "course",
label: "Course",
autoGenerated: true,
}
Files (with numeric prefixes)
content/learning/course/
βββ 01-introduction.md
βββ 02-setup.md
βββ 03-hello-world.md
βββ 04-variables.md
βββ 05-functions.md
βββ 06-advanced.md
βββ 07-conclusion.md
Result
π Course
βββ Introduction
βββ Setup
βββ Hello World
βββ Variables
βββ Functions
βββ Advanced
βββ Conclusion
(Numbered order preserved!)
Example 4: Filtering with navHidden
Setup
{
id: "guides",
label: "Guides",
autoGenerated: true,
}
Files
content/docs/guides/
βββ getting-started.md (normal)
βββ installation.md (normal)
βββ internal-notes.md (navHidden: true)
βββ performance-tips.md (normal)
βββ wip-section.md (draft: true)
Result
π Guides
βββ Getting Started
βββ Installation
βββ Performance Tips
(Internal Notes and WIP hidden)
Example 5: Growth Over Time
Month 1 (Initial Setup)
configuration:
autoGenerated: true
Files:
βββ overview.md
Sidebar:
βββ Overview
Month 3 (Growing)
(Same configuration, no changes)
Files:
βββ overview.md
βββ authentication.md
βββ caching.md
βββ database-setup.md
Sidebar:
βββ Authentication
βββ Caching
βββ Database Setup
βββ Overview
Month 6 (Large)
(Still same configuration!)
Files:
βββ overview.md
βββ authentication.md
βββ caching.md
βββ database-setup.md
βββ deployment.md
βββ error-handling.md
βββ logging.md
βββ monitoring.md
βββ performance.md
βββ security.md
βββ troubleshooting.md
Sidebar:
βββ Authentication
βββ Caching
βββ Database Setup
βββ Deployment
βββ Error Handling
βββ Logging
βββ Monitoring
βββ Overview
βββ Performance
βββ Security
βββ Troubleshooting
Key point: Configuration hasnβt changed at all, yet docs grew 10x!
Example 6: Mixed with Hidden Files
Setup
{
id: "docs",
label: "Documentation",
autoGenerated: true,
}
Files
content/main-docs/
βββ api.md
βββ architecture.md
βββ changelog.md
βββ deprecated-old-api.md (navHidden: true)
βββ features.md
βββ performance.md
βββ readme.md
βββ support.md
βββ wip-new-feature.md (draft: true)
Result
π Documentation
βββ Api
βββ Architecture
βββ Changelog
βββ Features
βββ Performance
βββ Readme
βββ Support
(Deprecated and WIP excluded)
Example 7: Nested Auto-Generation
Setup
{
id: "docs",
label: "Documentation",
groups: [
{
id: "core",
label: "Core",
groups: [
{
id: "concepts",
label: "Concepts",
autoGenerated: true, // Scans docs/core/concepts/
},
{
id: "guides",
label: "Guides",
autoGenerated: true, // Scans docs/core/guides/
},
],
},
{
id: "advanced",
label: "Advanced",
autoGenerated: true, // Scans docs/advanced/
},
],
}
Files
content/main-docs/
βββ core/
β βββ concepts/
β β βββ entries.md
β β βββ groups.md
β β βββ tabs.md
β βββ guides/
β βββ getting-started.md
β βββ setup.md
βββ advanced/
βββ performance.md
βββ security.md
βββ testing.md
Result
π Documentation
βββ Advanced
β βββ Performance
β βββ Security
β βββ Testing
βββ Core
βββ Concepts
β βββ Entries
β βββ Groups
β βββ Tabs
βββ Guides
βββ Getting Started
βββ Setup
Best Practices
-
Use numeric prefixes for tutorials
01-intro.md 02-setup.md 03-first-app.md -
Use navLabel for custom sidebar text
--- title: "Frequently Asked Questions" navLabel: "FAQ" --- -
Use navHidden for drafts
--- draft: true navHidden: true --- -
Combine with hybrid for control
entries: [{ slug: "overview" }], autoGenerated: true, // Rest auto-discovered
Next Steps
Learn about alternatives: