Skip to content

versions.ts#

View Markdown

Source

6 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

6 symbols 5 functions 1 modules 11 parameters 5 returns

Reference#

fncurrentVersionPrefix(options?: ResolvedVersionsOptions): stringPrefix used for the active version (empty string = site root).

Prefix used for the active version (empty string = site root).

Signature

export function currentVersionPrefix(options?: ResolvedVersionsOptions): string

View source

Parameters

Returns

string
fndecorateVersionedPages(pages: Array<{ outputPath: string; html: string }>, options: ResolvedVersionsOptions, outDir: string, base: string): voidApplies switcher / banner / search rewrite after every version tree is generate…

Applies switcher / banner / search rewrite after every version tree is generated.

Signature

export function decorateVersionedPages(pages: Array<{ outputPath: string; html: string }>, options: ResolvedVersionsOptions, outDir: string, base: string): void

View source

Parameters

Returns

void
fnresolveSnapshotDir(root: string, dir: string): string | undefinedConfines a snapshot dir to root.

Confines a snapshot dir to root.

Signature

export function resolveSnapshotDir(root: string, dir: string): string | undefined

View source

Parameters

  • root string
  • dir string

Returns

string | undefined
fnresolveVersionsOptions(value: boolean | VersionsOptions | undefined): ResolvedVersionsOptionsResolves versions. Omitted / false stay off. true enables a single current entr…

Resolves versions. Omitted / false stay off. true enables a single current entry. An object enables the feature and overrides set fields.

Signature

export function resolveVersionsOptions(value: boolean | VersionsOptions | undefined): ResolvedVersionsOptions

View source

Parameters

Returns

ResolvedVersionsOptions
fnversionLocation(outputPath: string, outDir: string, options: ResolvedVersionsOptions): { id: string; sibling: string }Version id and same-path remainder for a generated HTML file.

Version id and same-path remainder for a generated HTML file.

Signature

export function versionLocation(outputPath: string, outDir: string, options: ResolvedVersionsOptions): { id: string; sibling: string }

View source

Parameters

Returns

object
id
id: string;
sibling
sibling: string;
moduleversionsOpt-in documentation versioning: prefixes, snapshots, and header chrome. Historical snapshot directories are read-only…

Opt-in documentation versioning: prefixes, snapshots, and header chrome.

Historical snapshot directories are read-only during the build. Recreate them with an explicit snapshot command.

View source