Skip to content

Instantly share code, notes, and snippets.

@richinfante
Created December 6, 2015 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richinfante/dd79e86d64b440eeadce to your computer and use it in GitHub Desktop.
Save richinfante/dd79e86d64b440eeadce to your computer and use it in GitHub Desktop.
Sitemap for use with jekyll and github pages
---
layout: null
---
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>{{ prepend: site.baseurl | prepend: site.url | xml_escape }}</loc>
<lastmod>{{site.time | date: "%Y-%m-%d" | xml_escape }}</lastmod>
<priority>1</priority>
</url>
{% for page in site.pages %}
{% unless page.unlist %}
{% if page.title %}
<url>
<loc>{{ page.url | prepend: site.baseurl | prepend: site.url | xml_escape }}</loc>
<lastmod>{{ site.time | date: "%Y-%m-%d" | xml_escape }}</lastmod>
<priority>0.6</priority>
</url>
{% endif %}
{% endunless %}
{% endfor %}
{% for post in site.posts %}
{% unless page.unlist %}
<url>
<loc>{{ post.url | prepend: site.baseurl | prepend: site.url | xml_escape }}</loc>
<lastmod>{{ post.date | date: "%Y-%m-%d" | xml_escape }}</lastmod>
<priority>0.5</priority>
</url>
{% endunless %}
{% endfor %}
</urlset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment