Skip to content

Instantly share code, notes, and snippets.

@valryon

valryon/sitemap.xml

Created Apr 8, 2013
Embed
What would you like to do?
Simple sitemap.xml for Jekyll
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.sitemaps.org/schemas/sitemap-image/1.1" xmlns:video="http://www.sitemaps.org/schemas/sitemap-video/1.1">
{% for post in site.posts %}
{% unless post.hide %}
<url>
<loc>{{ site.url }}{{ post.url }}</loc>
{% if post.lastmod %}
<lastmod>{{ post.lastmod | date_to_xmlschema }}</lastmod>
{% else %}
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
{% endif %}
</url>
{% endunless %}
{% endfor %}
</urlset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment