Versions
module Versions| Assembly | Nacara.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
create (versions: SiteVersion list) : IPluginVersion switching, with the default options.
| Parameter | |
|---|---|
versions | Every version of the site, newest first. The one marked latest is where a reader arriving without a version lands. |
createWith (configure: VersionsOptions -> VersionsOptions) : IPlugin
createWith (configure: VersionsOptions -> VersionsOptions) : IPluginVersion switching, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. Anything it leaves alone keeps its default. |
defaults: VersionsOptionsmanifest (currentPrefix: string) (options: VersionsOptions) : string
manifest (currentPrefix: string) (options: VersionsOptions) : stringThe file the switcher reads, listing every version of the site.
| Parameter | |
|---|---|
currentPrefix | The prefix this build is deployed under, so the manifest can say which entry is the one being read. |
options | The versions declared, and where the manifest is written. |
manifestPath (value: string) (options: VersionsOptions) : VersionsOptions
manifestPath (value: string) (options: VersionsOptions) : VersionsOptionsWhere the manifest is written, relative to the output directory.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
register (versions: SiteVersion list) (site: Site) : Site
register (versions: SiteVersion list) (site: Site) : SiteAdd version switching to a site.
| Parameter | |
|---|---|
versions | Every version of the site, newest first. |
site | The site being described. |
registerWith (configure: VersionsOptions -> VersionsOptions) (site: Site) : Site
registerWith (configure: VersionsOptions -> VersionsOptions) (site: Site) : SiteAdd version switching to a site, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. Anything it leaves alone keeps its default. |
site | The site being described. |
showOutdatedNotice (value: bool) (options: VersionsOptions) : VersionsOptions
showOutdatedNotice (value: bool) (options: VersionsOptions) : VersionsOptionsShow a notice at the top of every page of an older version.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
switcher (options: VersionsOptions) (site: SiteInfo) : string
switcher (options: VersionsOptions) (site: SiteInfo) : stringThe control that moves a reader between versions.
| Parameter | |
|---|---|
options | The versions declared, and where the manifest is written. |
site | The site being rendered, for the URLs the switcher points at. |
NavbarEnd = [ NavbarDynamicWidget(Versions.switcher options) ]
versions (value: SiteVersion list) (options: VersionsOptions) : VersionsOptions
versions (value: SiteVersion list) (options: VersionsOptions) : VersionsOptionsSet Versions.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |