Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including wintersmith-sitemap with all npm packages installed. Try it out:

var wintersmithSitemap = require("wintersmith-sitemap")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

wintersmith-sitemap v1.0.0

A Wintersmith plugin to generate a sitemap.xml file

wintersmith-sitemap Build Status

A Wintersmith plugin to generate a sitemap.xml file

Installation

Install globally or locally using npm:

npm install [-g] wintersmith-sitemap wintersmith-contents

Add wintersmith-sitemap and wintersmith-contents to your config.json:

{
  "plugins": [
    "wintersmith-contents",
    "wintersmith-sitemap"
  ]
}

Define the url property in the locals property:

{
  "locals": {
    "url": "http://example.com"
  }
}

Usage

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 include more information like the last modification date, the change frequency, or the priority, you need to define this information in the metadata:

---
title: Hello, world!
date: 2014-10-31 23:59:59
changefreq: weekly
priority: 0.8
template: entry.jade
---

If you want to exclude a page from the sitemap, you need to define noindex: true in the metadata:

---
title: Hello, world!
date: 2014-10-31 23:59:59
template: entry.jade
noindex: true
---

License

wintersmith-sitemap is released under the MIT license.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free