A Middleman extension to create a sitemap for your Middleman site
Clone or download
Pull request Compare This branch is 2 commits ahead of statonjr:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



middleman-sitemap is an extension for the Middleman static site generator that adds sitemap functionality. By default, the sitemap is GZIP'd.

For large sites, middleman-sitemap will create a sitemap index file and multiple sitemaps as suggested by Google.


If you're just getting started, install the middleman gem and generate a new project:

gem install middleman
middleman init MY_PROJECT

If you already have a Middleman project: Add gem "middleman-sitemap" to your Gemfile and run bundle install


activate :sitemap

By default, middleman-sitemap will create a sitemap with loc1 elements. As per the [protocol](http://www.sitemaps.org/protocol.html), the lastmod, changefreq, and priority` elements are optional. To include these elements in your sitemap, you MUST include them in the front matter of your page.



GZIP is on by default, so the extension will produce a sitemap.xml.gz file in addition to the sitemap.xml file.

If you don't want to create a GZIP file, pass false during activation.

activate :sitemap, :gzip => false


The default hostname is set to "http://www.example.com". You probably want to change this to your hostname.

activate :sitemap, :hostname => "http://www.apple.com"

Build & Dependency Status

Build Status


The official community forum is available at: http://forum.middlemanapp.com

Bug Reports

Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems: https://github.com/middleman/middleman-blog/issues

The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit Pull Requests containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.

How to Run Cucumber Tests

WARNING: Support for multiple sitemaps means that Middleman has to build 51000 pages before creating the multiple sitemaps which, on my machine, takes almost 5 minutes per scenario. The multiple-sitemap features have been tagged with @slow.

  1. Checkout Repository: git clone https://github.com/statonjr/middleman-sitemap.git
  2. Install Bundler: gem install bundler
  3. Run bundle install inside the project root to install the gem dependencies.
  4. Run test cases: bundle exec rake test


Click here to lend your support to Middleman


Copyright (c) 2014 Larry Staton Jr. MIT Licensed, see LICENSE for details.