npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nera-static/plugin-page-navigation

v2.1.0

Published

A plugin for Nera static site generator to create sibling page navigation within directories. Perfect for section-based navigation and multi-page document structures.

Readme

@nera-static/plugin-page-navigation

A plugin for the Nera static site generator that creates a navigation between sibling pages or uses custom navigation definitions. Lightweight, flexible, and easy to integrate in any layout.

✨ Features

  • Automatically adds navigation based on sibling pages
  • Supports custom navigation via frontmatter
  • Optional sorting via position meta field
  • Configurable active class for the current page
  • Includes a ready-to-use Pug view

🚀 Installation

Install the plugin in your Nera project:

npm install @nera-static/plugin-page-navigation

Nera will automatically detect the plugin and apply the page navigation metadata during the build.

🛠️ Usage

Automatic sibling navigation

If you don’t define a page_navigation property in your markdown file, the plugin will automatically collect sibling pages from the same directory.

You can define a position field to control the sorting:

---
title: Page A
type: page
position: 1
---

Custom navigation

To override the navigation, define it in the frontmatter like this:

---
title: Page with custom nav
type: page
page_navigation:
    - href: /index.html
      name: Home
    - href: /contact.html
      name: Contact
---

🛠️ Publish Default Template

Use the default template provided by the plugin:

npx @nera-static/plugin-page-navigation run publish-template

This copies the template to:

views/vendor/plugin-page-navigation/page-navigation.pug

💡 The file contains multiple layout options. Uncomment the version that fits your needs.

Using the template in your layout

Once published, include the navigation in your Pug templates:

include views/vendor/plugin-page-navigation/page-navigation

The plugin provides three navigation styles:

  • +simpleNav - Basic horizontal navigation (default)
  • +pipeSeparated - Navigation with pipe separators
  • +linkList - Unordered list navigation

Available metadata

The plugin adds the following data to each page's meta object:

meta.pageNav = {
    activeClass: 'active', // CSS class for current page
    elements: [
        // Array of navigation items
        {
            name: 'Page Title',
            href: '/path/to/page.html',
            current: true, // true for current page
            position: 1,
        },
    ],
}

⚙️ Configuration

# config/page-navigation.yaml
active_page_nav_class: 'active'

This class will be applied to the currently active page in the navigation.

🧪 Development

npm install
npm test
npm run lint
npm run publish-template  # Publish templates to your project

Tests use Vitest and cover:

  • Sibling navigation detection
  • Custom overrides
  • Sorting via position
  • Active class behavior

🔄 Compatibility

  • Nera v4.1.0+: Full compatibility with latest static site generator
  • Node.js 18+: Modern JavaScript features and ES modules
  • Plugin Utils v1.1.0+: Enhanced plugin utilities integration

🏗️ Architecture

This plugin uses the getMetaData() function to process page data and inject sibling navigation information. It automatically detects pages in the same directory and provides multiple template formats.

🎨 BEM CSS Classes

The plugin uses BEM (Block Element Modifier) methodology:

  • .page-nav - Main navigation block
  • .page-nav__item - Navigation list items
  • .page-nav__link - Navigation links
  • .page-nav__link--active - Active page link
  • .page-nav--list - List-style navigation
  • .page-nav--pipe-separated - Pipe-separated navigation

🧑‍💻 Author

Michael Becker
https://github.com/seebaermichi

🔗 Links

📦 License

MIT