Sitemap Class

Summary

Generates a sitemap from the input documents.
Assembly
Wyam.Core.dll
Namespace
Wyam.Core.Modules.Contents
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IModule"] click Interface0 "/api/Wyam.Common.Modules/IModule" Type["Sitemap"] class Type type-node

Syntax

public class Sitemap : IModule

Remarks

This module generates a sitemap from the input documents. The output document contains the sitemap XML as it's content. You can supply a location for each item in the sitemap 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
Sitemap(DocumentConfig, Func<string, string>) Creates a sitemap 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.
Sitemap(Func<string, string>) Creates a sitemap 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.
Sitemap(string, Func<string, string>) Creates a sitemap 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 Value Summary
Execute(IReadOnlyList<IDocument>, IExecutionContext) IEnumerable<IDocument>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
GitHub