Skip to content

LinkValidator

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

Checks the links of the site that was built.

The markdown plugin resolves the links an author writes. This checks the site as published: every href and src in every rendered page, wherever it came from, against the files actually written.

Which catches an asset a theme names but never ships, a link written in html that no markdown pass saw, and an anchor that moved when a heading was reworded.

Declared inside

O

Functions and values

allowStatusCodes (value: int list) (options: LinkValidatorOptions) : LinkValidatorOptions

Status codes to accept beyond the usual 2xx and 3xx.

Parameter
valueThe codes to treat as reachable - 403 and 429 are common for bots.
optionsThe options so far.
cacheHours (value: int) (options: LinkValidatorOptions) : LinkValidatorOptions

How long an answer stays good, in hours.

Parameter
valueThe lifetime of a cached answer.
optionsThe options so far.
checkExternal (value: bool) (options: LinkValidatorOptions) : LinkValidatorOptions

Check links that leave the site.

Parameter
valueWhether to ask the network about them.
optionsThe options so far.
checkWhileWatching (value: bool) (options: LinkValidatorOptions) : LinkValidatorOptions

Check while watching too.

Parameter
valueWhether a watch build checks links.
optionsThe options so far.
concurrency (value: int) (options: LinkValidatorOptions) : LinkValidatorOptions

How many external links to check at once.

Parameter
valueThe number of links in flight.
optionsThe options so far.
create () : IPlugin

Checking the site's links, with the default options.

createWith (configure: LinkValidatorOptions -> LinkValidatorOptions) : IPlugin

Checking the site's links, configured.

Parameter
configureGiven the defaults, the options to use. Anything it leaves alone keeps its default.
failOnExternal (value: bool) (options: LinkValidatorOptions) : LinkValidatorOptions

Fail the build on a link that leaves the site and cannot be reached.

Parameter
valueWhether an unreachable external link is an error rather than a warning.
optionsThe options so far.
ignoring (value: string list) (options: LinkValidatorOptions) : LinkValidatorOptions

Links to leave alone, as regular expressions matched against the whole url.

Parameter
valueThe patterns to skip.
optionsThe options so far.
register (site: Site) : Site

Check every link the site publishes.

registerWith (configure: LinkValidatorOptions -> LinkValidatorOptions) (site: Site) : Site

Check every link the site publishes, configured.

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

Seconds to wait for a server before giving up on a link.

Parameter
valueThe timeout, in seconds.
optionsThe options so far.