Jekyll Sitemaps

published 10 Aug 2009 by Mark Percival
filed under: Code

We build and deploy this site with Jekyll, and one thing I haven't seen written about is a sitemap for Jekyll. Sitemaps are really simple and obvious, but it should save you about 15 minutes if your looking to do a quick sitemap in jekyll. Here's what we currently use for this site.

---
rooturi: http://squarepush.com
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <url>
      <loc>http://squarepush.com/</loc>
      <lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
      <changefreq>weekly</changefreq>
      <priority>1</priority>
   </url>
   <url>
      <loc>http://squarepush.com/contact.html</loc>
      <lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.8</priority>
   </url>
   <url>
      <loc>http://squarepush.com/about.html</loc>
      <lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.8</priority>
   </url>
   <url>
      <loc>http://squarepush.com/ps/</loc>
      <lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
      <changefreq>daily</changefreq>
      <priority>1</priority>
   </url>
{% for post in site.posts %}
   <url>
      <loc>{{ page.rooturl }}{{ post.url }}</loc>
      <lastmod>{{ site.time | date: '%Y-%m-%d' }}</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.8</priority>
   </url>
{% endfor %}
</urlset>


blog comments powered by Disqus