MirrorResources Wyam.Html

Mirrors external link and script resources locally.

For each input document, looks for link and script elements that link to external resources and copies them locally, replacing the link and script links to the local path. To prevent local mirroring for specific link and script elements, add a data-no-mirror attribute.

Note that because this module parses the document content as standards-compliant HTML and outputs the formatted post-parsed DOM, you should only place this module after all other template processing has been performed.

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

Usage

  • MirrorResources()

    Mirrors external resources locally. By default, resources will be copied into the output folder under the mirror directory.

  • MirrorResources(Func<Uri, FilePath> pathFunc)

    Mirrors external resources locally, specifying the output location where they should be copied.

    • pathFunc

      A function that specifies where downloaded external resources should be copied to.

GitHub