GenerateSitemap Class
Generates a site map from the input documents.
Namespace
Statiq.Core
Interfaces
Base Types
graph BT Type-->Base0["Module"] click Base0 "/api/Statiq.Common/Module" Base0-->Base1["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type["GenerateSitemap"] class Type type-node

Syntax

public class GenerateSitemap : Module, IModule

Remarks

This module generates a site map from the input documents. The output document contains the site map XML as it's content. You can supply a location for the each item in the site map as a string (with an optional function to format it into an absolute HTML path) or you can supply a SitemapItem for more control. You can also specify the Hostname metadata key (as a string) for each input document, which will be prepended to all locations.

Constructors

Name Summary
GenerateSitemap(Config<object>, Func<string, string>) Creates a site map using the specified delegate which should return either a string that contains the location for each input document or a SitemapItem instance with the location and other information. If the delegate returns null or does not return the correct type of object, a link to the document will be used.
GenerateSitemap(Func<string, string>) Creates a site map using the metadata key SitemapItem which should contain either a string that contains the location for each input document or a SitemapItem instance with the location and other information. If the key SitemapItem is not found or does not contain the correct type of object, a link to the document will be used.
GenerateSitemap(string, Func<string, string>) Creates a site map using the specified metadata key which should contain either a string that contains the location for each input document or a SitemapItem instance with the location and other information. If the metadata key is not found or does not contain the correct type of object, a link to the document will be used.

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
ExecuteContextAsync(IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module once for all input documents.
ExecuteInputAsync(IDocument, IExecutionContext) Task<IEnumerable<IDocument>>
Executes the module.
Inherited from 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

Extension Methods