Skip to content

Instantly share code, notes, and snippets.

@johntday
Created September 19, 2013 20:08
Show Gist options
  • Save johntday/6629132 to your computer and use it in GitHub Desktop.
Save johntday/6629132 to your computer and use it in GitHub Desktop.
Jekyll template for generating simple `sitemap.xml` for Google indexing.
---
layout: nil
title : "My Sitemap"
sitemap_exclude: y
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for post in site.posts %}
<url>
<loc>{{site.production_url}}{{ post.url | remove: 'index.html' }}</loc>
</url>
{% endfor %}
{% for page in site.pages %}
{% if page.sitemap_exclude != 'y' %}
<url>
<loc>{{site.production_url}}{{ page.url | remove: 'index.html' }}</loc>
</url>
{% endif %}
{% endfor %}
</urlset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment