Sitemap

The Sitemap module generates an XML sitemap for the content items of the site. The url is /sitemap.xml

Configuring the sitemap module

.UseModule<Sitemap>((Func<Type, bool>)(t => t != typeof(User)), (Func<Summary, bool>)(s => true)))

The Sitemap module has the following settings as in the example above:

  • IsInSitemap: this function from a Summary to a bool returns true if the summary should be in the sitemap
  • TypeInSitemap: this function from a Type to a bool returns true if the content type should be in the sitemap

Both functions should return true for a content item to be in the sitemap.

For /sitemap.xml to be served through the routing of ASP.Net MVC (instead of IIS looking for a static XML file), the following line should be added to web.config in the system.webservers/handlers element:

 

<add name="ManagedFileWithExtension" path="sitemap.xml" verb="*"
type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" preCondition="integratedMode" />