RelativeFileDirto be set, usually by the ReadFiles module),
RelativeFilePathto be set, usually by the
WritePathare set on an input document, that value will be used instead of what's specified in the module. For example, if you have a bunch of Razor .cshtml files that need to be rendered to .html files but one of them should be output as a .xml file instead, define the
WriteExtensionmetadata value in the front matter of the page.
Writes the document content to disk with the same file name and relative path as the input file. This requires metadata for
RelativeFilePathto be set, which is done by the
ReadFilesmodule or can be set manually.
Uses a delegate to describe where to write the content of each document. The output of the function should be either a full path to the disk location (including file name) or a path relative to the output folder.
A delegate that returns a
Wyam.Common.IO.FilePathwith the desired path.
Writes the document content to disk with the specified extension with the same base file name and relative path as the input file. This requires metadata for
RelativeFilePathto be set (which is done by default by the
The extension to use for writing the file.
Chain these methods together after the constructor to modify behavior.
Append(bool append = true)
Appends content to each file instead of overwriting them.
Appends to existing files if set to
IgnoreEmptyContent(bool ignoreEmptyContent = true)
Ignores documents with empty content, which is the default behavior.
If set to
true, documents with empty content will be ignored.
OnlyMetadata(bool onlyMetadata = true)
Indicates that only metadata should be added to the document and a file should not actually be written to the file system. This is useful for preprocessing documents so they appear in a pipeline with the correct write metadata, while actually writing them later with a second
WriteFilesmodule invocation. Only the following metadata values are written when this flag is turned on:
Destination...metadata values are not added to the document when only setting metadata..
If set to
true, metadata will be added to the input document(s) without actually writing them to the file system.
UseWriteMetadata(bool useWriteMetadata = true)
By default the metadata values for
WriteExtensionare checked and used first, even if a delegate is specified in the constructor. This method can be used to turn off the default behavior and always rely on the delegate for obtaining the write location.
If set to
false, metadata of the input document will not be used.
Specifies a predicate that must be satisfied for the file to be written.
A predicate that returns
trueif the file should be written.
The following metadata is added to each document.
The file name without any extension. Equivalent to
The full absolute directory of the file. Equivalent to
The extension of the file. Equivalent to
The full file name. Equivalent to
The full absolute path (including file name) of the destination file.
The full absolute path (including file name) of the destination file without the file extension.
The relative directory of the file from the Wyam output folder.
The relative path to the file (including file name) from the Wyam output folder.
The relative path to the file (including file name) from the Wyam output folder without the file extension.