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.
Usage
-
Sitemap(DocumentConfig sitemapItemOrLocation, Func<string, string> locationFormatter = null)
Creates a sitemap using the specified delegate which should return either a
string
that contains the location for each input document or aSitemapItem
instance with the location and other information. If the delegate returnsnull
or does not return the correct type of object, a link to the document will be used.sitemapItemOrLocation
A delegate that either returns a
SitemapItem
instance or astring
with the desired item location. If the delegate returnsnull
, the input document is not added to the sitemap.locationFormatter
A location formatter that will be applied to the location of each input after getting the value of the specified metadata key.
-
Sitemap(Func<string, string> locationFormatter = null)
Creates a sitemap using the metadata key
SitemapItem
which should contain either astring
that contains the location for each input document or aSitemapItem
instance with the location and other information. If the keySitemapItem
is not found or does not contain the correct type of object, a link to the document will be used.locationFormatter
A location formatter that will be applied to the location of each input after getting the value of the
SitemapItem
metadata key.
-
Sitemap(string sitemapItemOrLocationMetadataKey, Func<string, string> locationFormatter = null)
Creates a sitemap using the specified metadata key which should contain either a
string
that contains the location for each input document or aSitemapItem
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.sitemapItemOrLocationMetadataKey
A metadata key that contains either a
SitemapItem
or astring
location for each input document.locationFormatter
A location formatter that will be applied to the location of each input after getting the value of the specified metadata key.
Input Metadata
The metadata values listed below apply to individual documents and are typically set from front matter (with just the name of the key) and used as inputs to the module to control behavior.
-
Keys.SitemapItem
:Wyam.Common.Modules.Contents.SitemapItem
Contains a document-specific sitemap item for use when generating a sitemap.