PHPackages                             calevans/staticforge-chapternav - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. calevans/staticforge-chapternav

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

calevans/staticforge-chapternav
===============================

StaticForge Feature: ChapterNav

1.1.2(4mo ago)0101MITPHPPHP ^8.4

Since Dec 16Pushed 4mo agoCompare

[ Source](https://github.com/calevans/staticforge-chapternav)[ Packagist](https://packagist.org/packages/calevans/staticforge-chapternav)[ RSS](/packages/calevans-staticforge-chapternav/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (9)Used By (1)

Chapter Navigation for StaticForge
==================================

[](#chapter-navigation-for-staticforge)

**What it does:** Automatically generates sequential prev/next navigation links for documentation pages based on menu ordering.

Installation
------------

[](#installation)

```
composer require calevans/staticforge-chapternav
php vendor/bin/staticforge feature:setup calevans/staticforge-chapternav
```

Configuration
-------------

[](#configuration)

Set via `siteconfig.yaml` file.

```
# Chapter Navigation Configuration
chapter_nav:
  menus: "2"
  prev_symbol: "←"
  next_symbol: "→"
```

### Disabling Chapter Navigation

[](#disabling-chapter-navigation)

To completely disable chapter navigation processing, either:

- Set `menus: ""` (empty string) in your `siteconfig.yaml`
- Remove the `chapter_nav` section from `siteconfig.yaml` and ensure the `CHAPTER_NAV_MENUS` environment variable is not set.

How It Works
------------

[](#how-it-works)

Chapter Navigation uses the menu ordering from MenuBuilder to create sequential navigation between pages. Pages that appear in the configured menus automatically get prev/next links based on their menu position.

### Example Setup

[](#example-setup)

```
---
title = "Quick Start Guide"
menu = 2.1
template = "docs"
---
```

```
---
title = "Configuration Guide"
menu = 2.2
template = "docs"
---
```

**Results:**

- **Quick Start Guide** (2.1): Shows only "Next →" link to Configuration Guide
- **Configuration Guide** (2.2): Shows "← Prev" to Quick Start

Using in Templates
------------------

[](#using-in-templates)

The chapter navigation HTML is automatically generated. To display it in your template:

```
{% if features.ChapterNav.pages[source_file] is defined %}
  {% for menu_num, nav_data in features.ChapterNav.pages[source_file] %}
    {{ nav_data.html|raw }}
  {% endfor %}
{% endif %}
```

Navigation Data Structure
-------------------------

[](#navigation-data-structure)

Each page gets:

- `prev` - Previous page data (title, url, file) or null
- `current` - Current page data
- `next` - Next page data or null
- `html` - Pre-generated HTML for the navigation

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

8

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af70e3d71b3fb87f45c1025d3a21149958da1a416cabbebd4f450e18f920babc?d=identicon)[calevans](/maintainers/calevans)

---

Top Contributors

[![calevans](https://avatars.githubusercontent.com/u/426938?v=4)](https://github.com/calevans "calevans (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/calevans-staticforge-chapternav/health.svg)

```
[![Health](https://phpackages.com/badges/calevans-staticforge-chapternav/health.svg)](https://phpackages.com/packages/calevans-staticforge-chapternav)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
