pages

package
v0.161.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pages holds the rules a documentation branch obeys: which directories are versions, which version "latest" names, and the three files that follow from that.

⛔ IT IS SHARED BECAUSE TWO COMMANDS DECIDE THE SAME THING. pagespublish writes a version and then reconciles the branch; pagesretire removes superseded versions and then reconciles the branch. A second copy of "newest release, or main when none" is a second answer to the question `/latest/` asks, and the branch can only have one.

Index

Constants

This section is empty.

Variables

View Source
var VersionRE = regexp.MustCompile(`^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$`)

VersionRE matches a published documentation version: MAJOR.MINOR.

Functions

func Published

func Published(dir string) ([]string, error)

Published is the versions in the branch, newest release first and main last.

⛔ 0.10 SORTS AFTER 0.9, which string order gets wrong — and a documentation site that offers "latest" has to mean it.

func Reconcile

func Reconcile(dir string) (versions []string, latest string, err error)

Reconcile rewrites versions.json, the latest link and the root redirect from the version directories present, and reports the versions and which one latest now names.

func WriteLatest

func WriteLatest(dir, latest string) error

WriteLatest points the latest alias at one version.

func WriteRedirect

func WriteRedirect(dir string) error

WriteRedirect writes the branch root, which sends every reader to latest/.

func WriteVersions

func WriteVersions(dir string, versions []string, latest string) error

WriteVersions writes mike's versions.json, which the Hextra fork's version selector reads.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL