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 ¶
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 ¶
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 ¶
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 ¶
WriteLatest points the latest alias at one version.
func WriteRedirect ¶
WriteRedirect writes the branch root, which sends every reader to latest/.
Types ¶
This section is empty.