RenderHandlebars Class
Parses, compiles, and renders Handlebars templates.
Namespace
Statiq.Handlebars
Interfaces
Base Types
graph BT Type-->Base0["ParallelModule"] click Base0 "/api/Statiq.Common/ParallelModule" 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["RenderHandlebars"] class Type type-node

Syntax

public class RenderHandlebars : ParallelModule, IModule, IParallelModule

Remarks

Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. See this guide for an introduction to Handlebars.

This module user Handlebars.Net to render Handlebars templates. Handlebars.Net doesn't use a scripting engine to run a Javascript library - it compiles Handlebars templates directly to IL bytecode. It also mimics the JS library's API as closely as possible.

Constructors

Name Summary
RenderHandlebars() Parses Handlebars templates in each input document and outputs documents with rendered content.
RenderHandlebars(string, string) Parses Handlebars templates in the metadata of each input document and outputs documents with metadata containing the rendered content.

Properties

Name Property Type Summary
Parallel bool
Indicates whether documents will be processed by this module in parallel.
Inherited from ParallelModule

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
Configure(Action<IExecutionContext, IDocument, IHandlebars>) RenderHandlebars
Specifies an extension point to configure the handlebars environment for each page based on the current input document and context.
Configure(Func<IExecutionContext, IDocument, IHandlebars, Task>) RenderHandlebars
Specifies an extension point to configure the handlebars environment for each page based on the current input document and context.
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
ExecuteContextAsync(IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module once for all input documents.
Inherited from ParallelModule
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
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
WithBlockHelper(string, Config<HandlebarsBlockHelper>) RenderHandlebars
Specifies a block helper to be registered for each page based on the current input document and context.
WithHelper(string, Config<HandlebarsHelper>) RenderHandlebars
Specifies a helper to be registered for each page based on the current input document and context.
WithModel(Config<object>) RenderHandlebars
Specifies a model to use for each page based on the current input document and context.
WithPartial(string, Config<string>) RenderHandlebars
Specifies a partial template to be registered for each page based on the current input document and context.

Extension Methods