Skip to content

Setting up navigation

DocsForge provides rich navigation options. Configure them in docsforge.yml under theme.features.

By default, DocsForge builds navigation from your docs/ directory structure:

docs/
├── index.md
├── getting-started.md
├── setup/
│   ├── index.md
│   ├── colors.md
│   └── fonts.md
└── reference/
    ├── index.md
    └── markdown.md

This creates:
- Home
- Getting started
- Setup (expandable section)
- Setup overview (index page)
- Colors
- Fonts
- Reference (expandable section)
- Reference overview (index page)
- Markdown

Top-level navigation tabs

Convert top-level sections into tabs:

theme:
  features:
    - navigation.tabs

Tip

Combine with navigation.tabs.sticky to keep tabs visible when scrolling:

theme:
  features:
    - navigation.tabs
    - navigation.tabs.sticky

Section indexes

Make section headers clickable, linking to their index.md:

theme:
  features:
    - navigation.indexes

Expand sections by default

theme:
  features:
    - navigation.expand

Section grouping

Group navigation items into collapsible sections (enabled by default):

theme:
  features:
    - navigation.sections

Back-to-top button

Show a "back to top" button when scrolling down:

theme:
  features:
    - navigation.top

Add previous/next page links at the bottom of each page:

theme:
  features:
    - navigation.footer

Table of contents

Follow active anchor

Highlight the current section in the table of contents as you scroll:

theme:
  features:
    - toc.follow

Integrate with navigation

Move the table of contents into the navigation sidebar (for narrow layouts):

theme:
  features:
    - toc.integrate

Custom navigation

Define navigation explicitly in docsforge.yml:

nav:
  - Home: index.md
  - Getting Started:
    - Installation: getting-started.md
    - Quick start: quick-start.md
  - Setup:
    - setup/index.md
    - Colors: setup/colors.md
    - Fonts: setup/fonts.md

Highlight the current page in the navigation:

theme:
  features:
    - navigation.tracking

Enabled by default.

Complete navigation example

theme:
  features:
    - navigation.tabs
    - navigation.sections
    - navigation.indexes
    - navigation.top
    - navigation.footer
    - navigation.tracking
    - toc.follow

Next steps