Help us shape the future of Go! Take the 2026 Go Developer Survey

pages

package
v0.62.0 Latest Latest
Warning

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

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

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