Search Documentation

Search for pages and headings in the documentation

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: