Understanding Nested Groups
Nested Groups are groups within groups, creating a deeper hierarchy. This is where CelestialDocs truly shines for complex documentation.
What are Nested Groups?
A nested group is a group that contains subgroups instead of (or in addition to) entries:
Group: "Advanced Topics"
βββ Subgroup: "Performance"
β βββ Entry: Caching Strategies
β βββ Entry: Database Optimization
β βββ Entry: Load Balancing
βββ Subgroup: "Security"
β βββ Entry: Authentication
β βββ Entry: Authorization
β βββ Entry: Encryption
βββ Subgroup: "Deployment"
βββ Entry: Docker Setup
βββ Entry: Kubernetes Config
βββ Entry: CI/CD Pipeline
Hierarchy Levels
CelestialDocs supports unlimited nesting depth:
Level 1: Tab (or Default Tab)
βββ Level 2: Group
βββ Level 3: Subgroup
βββ Level 4: Sub-subgroup
βββ Level 5: Entries
In practice, keep it to 3-4 levels for UX reasonsβbeyond that, navigation becomes complex.
Creating Nested Groups
Nested groups are defined using the groups property instead of entries:
Simple Nesting (2 Levels)
{
id: "configuration",
label: "Configuration",
icon: "βοΈ",
groups: [
{
id: "basics",
label: "Basics",
entries: [
{ slug: "configuration/basics/overview" },
{ slug: "configuration/basics/setup" },
],
},
{
id: "advanced",
label: "Advanced",
entries: [
{ slug: "configuration/advanced/caching" },
{ slug: "configuration/advanced/security" },
],
},
],
}
Sidebar renders as:
βοΈ Configuration
βββ Basics
β βββ Overview
β βββ Setup
βββ Advanced
βββ Caching
βββ Security
Deeper Nesting (3+ Levels)
{
id: "advanced",
label: "Advanced Topics",
icon: "π",
groups: [
{
id: "architecture",
label: "Architecture",
groups: [
{
id: "patterns",
label: "Design Patterns",
entries: [
{ slug: "advanced/architecture/patterns/observer" },
{ slug: "advanced/architecture/patterns/factory" },
],
},
{
id: "performance",
label: "Performance",
entries: [
{ slug: "advanced/architecture/performance/caching" },
{ slug: "advanced/architecture/performance/optimization" },
],
},
],
},
],
}
Sidebar renders as:
π Advanced Topics
βββ Architecture
βββ Design Patterns
β βββ Observer
β βββ Factory
βββ Performance
βββ Caching
βββ Optimization
Mixing Entries and Subgroups
A group can have both entries and subgroups:
{
id: "features",
label: "Features",
entries: [
{ slug: "features/overview" }, // Top-level entries
],
groups: [
{
id: "authentication",
label: "Authentication",
entries: [
{ slug: "features/auth/oauth" },
{ slug: "features/auth/saml" },
],
},
],
}
Sidebar renders as:
Features
βββ Overview (entry at group level)
βββ Authentication (subgroup)
βββ OAuth
βββ SAML
File Structure for Nested Groups
Your content folder structure should reflect your nested organization:
content/my-docs/
βββ advanced/
β βββ architecture/
β β βββ patterns/
β β β βββ observer.md
β β β βββ factory.md
β β βββ performance/
β β βββ caching.md
β β βββ optimization.md
β βββ security/
β β βββ authentication.md
β β βββ encryption.md
This matches the configuration structure, making it intuitive.
Auto-Generation with Nested Groups
Auto-generation works at every nesting level:
{
id: "documentation",
label: "Documentation",
groups: [
{
id: "guides",
label: "Guides",
autoGenerated: true, // Scans content/my-docs/documentation/guides/
},
{
id: "api-reference",
label: "API Reference",
groups: [
{
id: "endpoints",
label: "Endpoints",
autoGenerated: true, // Scans content/my-docs/documentation/api-reference/endpoints/
},
],
},
],
}
Real-World Example
This siteβs own structure demonstrates nested groups. Open the sidebar and see:
Navigation System (Tab)
βββ Core Concepts (Group)
β βββ Entries
β βββ Groups
β βββ Nested Groups <- You're reading this!
β βββ Tabs
βββ Hierarchy (Group)
β βββ Three-Tier Overview
β βββ Visual Guide
β βββ Real-World Examples
Benefits of Nested Groups
β Scalability: Organize 10 pages or 10,000 pages β Clarity: Deep hierarchies are intuitive for complex topics β Flexibility: Mix manual and auto-generated at each level β User Experience: Users understand the structure immediately
When to Use Nested Groups
- β Large documentation (100+ pages)
- β Multiple related topics (e.g., different API versions)
- β Tutorials with many chapters
- β Enterprise systems with complex features
When NOT to Use Nested Groups
- β Very small documentation (under 20 pagesβkeep it flat)
- β Unrelated topics (use tabs instead for organization)
- β More than 4-5 nesting levels (affects UX)
Next Steps
Learn about:
- Tabs - Promote groups to tabs
- Configuration Guide
- Real-World Examples