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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@opendevise/antora-release-line-extension

v1.0.0

Published

An Antora extension that identifies and adds URL routing for SemVer release lines.

Downloads

179

Readme

Antora Release Line Extension

The Antora Release Line Extension identifies SemVer release lines (major, major.minor) and configures URL routes to the latest version in each line.

Overview

A SemVer release line consists of two series (major and major.minor) as well as an actual version (major.minor.patch). This extension automatically detects the use of SemVer release lines in versioned documentation components in your site. It then sets up routes using URL rewrites (i.e., splat aliases) to the latest version in each line from each series.

  • major -> major.minor
  • major.minor.patch -> major.minor

To support these routes, it changes the version segment in the URL for the actual version to major.minor (without changing the version in the model).

  • major.minor.patch -> major.minor

Normally prereleases are ignored. However, if a release line only consists of prereleases, then the latest prerelease is used as the latest release in that release line.

If the actual version is the latest version of the documentation component, and the latest version segment (e.g., latest) is enabled, the latest version segment will be used as the target instead.

  • major -> latest
  • major.minor -> latest
  • major.minor.patch -> latest

The idea behind this extension is that URLs to major and patch versions get routed (i.e., redirected) to the release line URL, which is the minor version. This URL manipulation and routing helps funnel users to the latest version and makes URLs more stable. In that regard, the extension serves a similar purpose as the latest version segment feature of Antora, except it recognizes the latest version in each release line.

Example

Let’s assume that you have a component with the following actual versions:

  • 3.1.0
  • 3.0.1
  • 3.0.0

This extension will then change the version segment in the URL for the following versions:

  • 3.1.0 -> 3.1
  • 3.0.1 -> 3.0

It will then set up the following redirects (i.e., splat aliases):

  • 3 -> 3.1
  • 3.1.0 -> 3.1
  • 3.0.1 -> 3.0

Prerequisites

In order to use this extension, you must be using Node.js 16 and Antora 3.2.0-alpha.2. The following instructions assume you’ve already set up an Antora playbook file (i.e., antora-playbook.yml) to build your site.

To learn about using extensions with Antora, see the Antora extension documentation.

Install

Use the following command to install the extension into your Antora playbook project:

$ npm i @opendevise/antora-release-line-extension

Register

Open your Antora playbook file and register the extension as an entry in the antora.extensions key. If this key doesn’t yet exist in your playbook, first create it.

antora-playbook.yml

antora:
  extensions:
  - '@opendevise/antora-release-line-extension'

Configure

There’s no configuration necessary to enable the version segment redirects for SemVer release lines.

Copyright and License

Copyright (C) 2022-present by OpenDevise Inc. and the individual contributors to this project.

Use of this software is granted under the terms of the Mozilla Public License Version 2.0 (MPL-2.0).