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 punch-sitemap-generator with all npm packages installed. Try it out:

var punchSitemapGenerator = require("punch-sitemap-generator")

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

punch-sitemap-generator v0.0.5

Plugin to create the sitemap.xml for your Punch sites.

Punch Sitemap Generator

Plugin to create the sitemap.xml for your Punch sites.

How to Use

  • Install the package

    npm install punch-sitemap-generator

  • Open your Punch project's configurations (config.json) and add the following:

      "plugins": {
          "generator_hooks": {
              "sitemap_generator": "punch-sitemap-generator"
  • Settings for the sitemap generator plugin must be specified under sitemap_generator in the config.json.

      "sitemap_generator": {
          "url_root": ""    

You can set the following options for the sitemap_generator:

- `url_root` (**required**) - Root URL (host and protocol) of your published site.

- `changefreq` - Change frequency for all pages in the site (default `weekly`)

- `exclude_urls` - An array of full URLs to exclude from the sitemap (eg. ``).

- `manual_entries` - List of manual URL entries to include in the sitemap. (eg. `[ { "loc": "", "priority": "0.6", "lastmod": "2012-01-01", "changefreq": "yearly" } ]`)

- `url_extension` - The extension to add to the urls except if already present or if there is a trailing slash (eg. `.html`)
  • sitemap.xml will be generated along with the rest of the files in your site when you run the command punch generate (punch g). It will be stored in the output directory, ready to be published.


Copyright (c) 2012 Lakshan Perera
Licensed 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