Skip to content

Versions

module Versions
AssemblyNacara.Plugin.Versions
Attributes[<RequireQualifiedAccess>]

Publishing several versions of a site side by side.

A version is a build, not a content dimension: each is built with its own prefix into its own directory. An old version is never rebuilt, so it cannot break, and building the current docs costs the same whether there is one version or twenty.

This plugin provides what those builds share: a manifest of what exists, and a switcher that rewrites the path.

Functions and values

create (versions: SiteVersion list) : IPlugin

Version switching, with the default options.

Parameter
versionsEvery version of the site, newest first. The one marked latest is where a reader arriving without a version lands.
createWith (configure: VersionsOptions -> VersionsOptions) : IPlugin

Version switching, configured.

Parameter
configureGiven the defaults, the options to use. Anything it leaves alone keeps its default.
defaults: VersionsOptions
manifest (currentPrefix: string) (options: VersionsOptions) : string

The file the switcher reads, listing every version of the site.

Parameter
currentPrefixThe prefix this build is deployed under, so the manifest can say which entry is the one being read.
optionsThe versions declared, and where the manifest is written.
manifestPath (value: string) (options: VersionsOptions) : VersionsOptions

Where the manifest is written, relative to the output directory.

Parameter
valueThe value to use.
optionsThe options so far.
register (versions: SiteVersion list) (site: Site) : Site

Add version switching to a site.

Parameter
versionsEvery version of the site, newest first.
siteThe site being described.
registerWith (configure: VersionsOptions -> VersionsOptions) (site: Site) : Site

Add version switching to a site, configured.

Parameter
configureGiven the defaults, the options to use. Anything it leaves alone keeps its default.
siteThe site being described.
showOutdatedNotice (value: bool) (options: VersionsOptions) : VersionsOptions

Show a notice at the top of every page of an older version.

Parameter
valueThe value to use.
optionsThe options so far.
switcher (options: VersionsOptions) (site: SiteInfo) : string

The control that moves a reader between versions.

Parameter
optionsThe versions declared, and where the manifest is written.
siteThe site being rendered, for the URLs the switcher points at.
NavbarEnd = [ NavbarDynamicWidget(Versions.switcher options) ]
versions (value: SiteVersion list) (options: VersionsOptions) : VersionsOptions

Set Versions.

Parameter
valueThe value to use.
optionsThe options so far.