WithPlaceholderFactory(Func<string[], IMetadata, IExecutionContext, Task<IDocument>>) Method
Allows you to specify a factory function for the creation of placeholder documents which get created to represent nodes in the tree for which there was no input document. The factory gets passed the current tree path, the set of tree metadata that should be set in the document, and the execution context which can be used to create a new document. If the factory function returns null, a new document with the tree metadata is created.
Namespace
Statiq.Core
Containing Type
CreateTree

Syntax

public CreateTree WithPlaceholderFactory(Func<string[], IMetadata, IExecutionContext, Task<IDocument>> factory)

Remarks

You should also turn on nesting with WithNesting(bool, bool) to generate placeholder documents. The default placeholder factory creates a document at the current tree path with the file name defined in IndexFileName.

Parameters

Name Type Description
factory Func<string[], IMetadata, IExecutionContext, Task<IDocument>> The factory function.

Return Value

Type Description
CreateTree The current module instance.