A metalsmith plugin for generating a sitemap
$ npm install metalsmith-mapsite
var sitemap = ;;
The hostname used for generating the urls.
Change the default changefreq.
A multimatch pattern. Only files that match this pattern will be included in the sitemap. Can be a string or an array of strings.
Change the default priority.
Change the output file for the sitemap.
Will remove extensions from the urls in the sitemap. Useful when you're rewriting urls.
Will replace any paths ending in
''. Useful when you're using metalsmith-permalinks.
Some values can also be set on a file-to-file basis from a file's frontmatter, the options are:
canonical: will override the filename used to generate the url. The path is relative to the hostname.
changefreq: will override any other settings for
changefreqfor the current file.
lastmod: will override any other settings for
lastmodfor the current file.
priority: will override any other settings for
priorityfor the current file.
private: will exclude the file from the sitemap when set to true.
---canonical: 'different'changefreq: alwayslastmod: 2014-12-01priority: 1.0private: true---<!-- index.html -->
Metalsmith-mapsite is a fork of metalsmith-sitemap. After refactoring metalsmith-sitemap I decided I would like to keep the plugin as simple as possible, to minimize possible points of failure and because it already does a lot.
This conflicted with the maintainer's goals, which is why I forked the plugin to metalsmith-mapsite. Mainly just for personal use, but maybe it'll be of use for others as well!