- Namespace
- Statiq
.Core - Interfaces
- Base Types
-
- object
- Module
Syntax
public class CreateTree : Module, IModule
Remarks
By default, this module is configured to generate a tree that mimics the directory structure of each document's destination path. Any documents with a file name of "index.*" are automatically promoted to the node that represents the parent folder level. For any folder that does not contain an "index.*" file, an empty placeholder tree node is used to represent the folder.
Note that if you clone documents from the tree, the relationships of the cloned document (parent, child, etc.) will not be updated to the new clones. In other words, your new document will still be pointing to the old versions of it's parent, children, etc. To update the tree after cloning documents you will need to recreate it by rerunning this module on all the newly created documents again.
Constructors
Name | Summary |
---|---|
CreateTree |
Creates a new tree module. |
Methods
Name | Return Value | Summary |
---|---|---|
AfterExecution |
void |
Called after each module execution.
Inherited from Module
|
AfterExecutionAsync |
Task |
Called after each module execution.
Inherited from Module
|
BeforeExecution |
void |
Called before each module execution.
Inherited from Module
|
BeforeExecutionAsync |
Task |
Called before each module execution.
Inherited from Module
|
ExecuteAsync |
Task |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
|
ExecuteContextAsync |
Task |
Executes the module once for all input documents.
|
ExecuteInputAsync |
Task |
Executes the module.
Inherited from Module
|
Finally |
void |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
FinallyAsync |
Task |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
WithChildrenKey |
CreateTree |
Changes the default children metadata key.
|
WithNesting |
CreateTree |
Indicates that the module should only output root nodes (instead of all
nodes which is the default behavior).
|
With |
CreateTree |
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.
|
WithRoots |
CreateTree |
Specifies for each document if it is a root of a tree. This results in splitting the generated tree into multiple smaller ones,
removing the root node from the set of children of it's parent and setting it's parent to
null .
|
WithSort |
CreateTree |
This specifies how the children of a given tree node should be sorted.
The default behavior is to preserve the original sorting order of the input documents.
|
WithTreePath |
CreateTree |
Defines the structure of the tree. If the delegate returns
null the document
is excluded from the tree.
|
WithTreePathKey |
CreateTree |
Changes the default tree path metadata key.
|