A Wintersmith plugin to generate a sitemap.xml file
Install globally or locally using npm
npm install [-g] wintersmith-sitemap wintersmith-contents
and add wintersmith-sitemap
and wintersmith-contents
to your config.json
{
"plugins": [
"wintersmith-contents",
"wintersmith-sitemap"
]
}
and define the url
property in the locals
section
{
"locals": {
"url": "http://example.com"
}
}
wintersmith-sitemap
extracts all Markdown pages from the content tree and lists them into the sitemap. By default, the sitemap only contains the location of all pages. If you need to set up their last modification date, their change frequency or their priority, you may want to define them into their metadata:
---
title: Hello, world!
date: 2014-10-31 23:59:59
changefreq: weekly
priority: 0.8
template: entry.jade
---
In addition, you may want to exclude a page from the sitemap by adding noindex: true
to its metadata:
---
title: Hello, world!
date: 2014-10-31 23:59:59
template: entry.jade
noindex: true
---
npm install
npm test