So Jekyll is awesome! Fast, lean, and mean. But what about sitemaps?

It’s actually really easy.

Via a Plugin

A very simple way is to use the jekyll-sitemap plugin. This plugin, when activated, will create a sitemap.xml file on your site that will contain a list of all of your pages.

Add this to your _config.yaml file, making sure to add it to the following ‘gems’ and ‘whitelists’ areas if they are already specified:

  - jekyll-sitemap

  - jekyll-sitemap

Depending on your setup, you may have to add it to you Gemfile:

gem "jekyll-sitemap"

And then either install the gem:

bundle install

Now just build/serve, and you have your sitemap!

Via a file

The other option is to make a file called ‘sitemap.xml’ in your main jekyll folder, as in next to _post, _pages, and _includes.

All the file needs to contain is the following:

layout: null
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="" xsi:schemaLocation="" xmlns="">
  {% for post in site.posts %}
      <loc>{{ site.url }}{{ post.url }}</loc>
      {% if post.lastmod == null %}
        <lastmod>{{ | date_to_xmlschema }}</lastmod>
      {% else %}
        <lastmod>{{ post.lastmod | date_to_xmlschema }}</lastmod>
      {% endif %}
  {% endfor %}
  {% for page in site.pages %}
    {% if page.sitemap != null and page.sitemap != empty %}
        <loc>{{ site.url }}{{ page.url }}</loc>
        <lastmod>{{ page.sitemap.lastmod | date_to_xmlschema }}</lastmod>
        <changefreq>{{ page.sitemap.changefreq }}</changefreq>
        <priority>{{ page.sitemap.priority }}</priority>
    {% endif %}
  {% endfor %}

When you run serve or build, the liquid code above will generate a list of all the pages in your blog/site and serve/save it as ’’