Module Nanoc::Helpers::XMLSitemap
In: lib/nanoc/helpers/xml_sitemap.rb

Nanoc::Helpers::XMLSitemap contains functionality for building XML sitemaps that will be crawled by search engines. See the Sitemaps protocol web site, www.sitemaps.org, for details.

Methods

Public Instance methods

Returns the XML sitemap as a string.

The following attributes can optionally be set on pages to change the behaviour of the sitemap:

  • ‘changefreq’, containing the estimated change frequency as defined by the Sitemaps protocol.
  • ‘priority’, containing the page‘s priority, ranging from 0.0 to 1.0, as defined by the Sitemaps protocol.

The sitemap will also include dates on which the pages were updated. These are generated automatically; the way this happens depends on the used data source (the filesystem data source checks the file mtimes, for instance).

The sitemap page will need to have the following attributes:

  • ‘base_url’, containing the URL to the site, without trailing slash. For example, if the site is at "example.com/", the base_url would be "example.com". It is probably a good idea to define this in the page defaults, i.e. the ‘meta.yaml’ file (at least if the filesystem data source is being used, which is probably the case).

[Validate]