Download the PHP package calevans/staticforge-chapternav without Composer

On this page you can find all versions of the php package calevans/staticforge-chapternav. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package staticforge-chapternav

Chapter Navigation for StaticForge

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

Requires PHP 8.5+ and StaticForge 3.x.

Installation

Configuration

Set via your siteconfig.yaml file.

Key Default Meaning
menus (none) Which MenuBuilder menu numbers get sequential navigation. A single number or a comma-separated list.
prev_symbol ← Prefix for the "previous chapter" link.
next_symbol → Suffix for the "next chapter" link.

menus accepts a bare number (menus: 2), a quoted one (menus: "2"), a comma-separated list (menus: "2, 3"), or a YAML list (menus: [2, 3]). Entries that are not numeric are ignored with a warning in the build log — menu numbers are always integers, because that is what MenuBuilder produces.

Environment variable fallback

If siteconfig.yaml has no chapter_nav: block at all, these are read instead. Prefer siteconfig.yaml; these exist for parity with older installs.

The two sources are not merged. A present chapter_nav: block wins outright.

Disabling Chapter Navigation

To completely disable chapter navigation processing, either:

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.

It runs on POST_GLOB at priority 150, after MenuBuilder (priority 100) has published its menu structure. MenuBuilder must be enabled; if it is disabled, ChapterNav logs a warning and does nothing.

Example Setup

Frontmatter is YAML.

Results:

Third-level menu entries (menu = 2.2.1) are dropdown children. They still get sequential navigation, but a dropdown's own label — the X.Y.0 entry under a parent that is not itself a page — is skipped, since it links nowhere.

Using in Templates

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

Navigation Data Structure

Each page gets:

features.ChapterNav is written only when there is something to write. If no menus are configured, or MenuBuilder published no menu files, the key is absent entirely — hence the is defined guard above. A configured menu that matches no pages yields pages: [].

URL handling

Every URL passes through a scheme allowlist: relative, fragment, and protocol-relative URLs are allowed, as are http, https, and mailto. Anything else — javascript:, data:, and obfuscated variants — is replaced with # and logged as a warning.

This applies to prev.url, current.url, and next.url as well as to the pre-generated html, so building your own <a href="{{ nav.next.url }}"> is as safe as using nav_data.html. The values in the data are not HTML-escaped — Twig autoescapes them for you, and escaping twice would turn every & in a query string into &amp;amp;. Inside html, where Twig cannot help because it is emitted with |raw, titles, symbols, and hrefs are escaped.

Development


All versions of staticforge-chapternav with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
eicc/staticforge Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package calevans/staticforge-chapternav contains the following files

Loading the files please wait ...