ValidateLinks Wyam.Html

Performs link validation for HTML elements such as anchors, images, and other resources.
Both relative and absolute links can be validated, though only relative links are checked by default due to the time it takes to check absolute links.

Package

This module exists in the Wyam.Html package which is not part of the core distribution. Add the following preprocessor directive to your configuration file to use it:
#n Wyam.Html
Alternativly, you can add all modules at once with the following preprocessor directive:
#n Wyam.All

Usage

  • ValidateLinks()

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • AsError(bool asError = true)

    When the validation process is complete, all the validation failures will be output as warnings. This method can be used to report all of the failures as errors instead (possibly breaking the generation).

    • asError

      true to report failures as an error.

  • ValidateAbsoluteLinks(bool validateAbsoluteLinks = true)

    Validates absolute (often external) links. This may add a significant delay to your generation process so it's recommended absolute links are only checked periodically. The default behavior is not to check absolute links. Also note that false positive failures are common when validating external links so any links that fail the check should be subsequently checked manually.

    • validateAbsoluteLinks

      true to validate absolute links.

  • ValidateRelativeLinks(bool validateRelativeLinks = true)

    Validates relative links, which is activated by default.

    • validateRelativeLinks

      true to validate relative links.

GitHub