SetDestination Class
Sets the document destination.
graph BT Type-->Base0["ParallelConfigModule<NormalizedPath>"] Base0-->Base1["Module"] click Base1 "/api/Statiq.Common/Module" Base1-->Base2["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type-.->Interface1["IParallelModule"] click Interface1 "/api/Statiq.Common/IParallelModule" Type["SetDestination"] class Type type-node

Syntax

public class SetDestination : ParallelConfigModule<NormalizedPath>, IModule, IParallelModule

Remarks

This module is typically used before WriteFiles to set the Destination prior to writing the document. If an extension is provided, this module will change the extension of the destination path for each input document. If the metadata keys DestinationPath, DestinationFileName, or DestinationExtension are set (in that order of precedence), the value will be used instead of the specified extension. 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 DestinationExtension metadata value in the front matter of the page. If a delegate is provided, it takes precedence over the metadata values (but can use them if needed).

Constructors

Name Summary
SetDestination() Sets the destination of input documents according to the metadata values for DestinationPath, DestinationFileName, or DestinationExtension (in that order of precedence). If none of those metadata values are set, the destination will remain unchanged.
SetDestination(bool) Changes the destination extension of input documents to the default page extension defined in the setting PageFileExtensions (which defaults to ".html"). If DestinationPath, DestinationFileName, or DestinationExtension metadata values are set, those will take precedence.
SetDestination(Config<NormalizedPath>, bool) Changes the destination of input documents to that of the delegate.
SetDestination(string) Changes the destination extension of input documents to the specified extension. If DestinationPath, DestinationFileName, or DestinationExtension metadata values are set, those will take precedence.

Methods

Name Return Value Summary
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
ExecuteConfigAsync(IDocument, IExecutionContext, NormalizedPath) Task<IEnumerable<IDocument>>
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
GetCurrentDestinationFromMetadata(IDocument) NormalizedPath
static

Extension Methods