Skip to content

Awesome Nav Plugin

Automatic navigation generation from folder structure.

Core Attributes

Plugin Name

awesome-nav

Installation

Bash
pip install mkdocs-awesome-nav

Configuration

YAML
plugins:
  - awesome-nav:
      strict: true
      show_nav_section_titles: true

How It Works

Awesome Nav generates navigation automatically based on your file structure:

Text Only
docs/
├── index.md
├── getting-started/
│   ├── index.md
│   ├── installation.md
│   └── quickstart.md
└── advanced/
    ├── configuration.md
    └── deployment.md

Becomes:

  • Home
  • Getting Started
  • Installation
  • Quickstart
  • Advanced
  • Configuration
  • Deployment

Customization

Using .pages Files

Create .pages files to customize navigation:

YAML
# docs/getting-started/.pages
title: Quick Start Guide
nav:
  - Overview: index.md
  - installation.md
  - quickstart.md
  - ...

Ordering

Numeric Prefixes:

Text Only
01-introduction.md
02-installation.md
03-configuration.md

Custom Order:

YAML
# .pages
nav:
  - introduction.md
  - installation.md
  - configuration.md
  - ...

Hiding Files

Hide files from navigation:

YAML
# .pages
hide:
  - draft-page.md
  - internal-docs.md

Options Reference

strict

Fail build on errors: true or false

show_nav_section_titles

Show section titles in navigation: true or false

collapse_single_pages

Collapse sections with one page: true or false

Advanced Features

Section Index

Combined with section-index plugin:

Text Only
docs/
└── user-guide/
    ├── index.md  # Represents entire section
    ├── page1.md
    └── page2.md

Dynamic Titles

Automatically extracts titles from: 1. H1 heading in markdown file 2. Filename (converted to title case) 3. Custom title in .pages

Rest Syntax

Use ... to include all remaining files:

YAML
nav:
  - index.md
  - important.md
  - ...  # All other files

Best Practices

  1. Use meaningful file and folder names
  2. Create index.md for sections
  3. Use .pages for custom ordering
  4. Keep structure shallow when possible
  5. Test navigation on mobile