Skip to content

Instantly share code, notes, and snippets.

@justinhillsjohnson
Created February 24, 2015 16:05
Show Gist options
  • Save justinhillsjohnson/a6275753ad014c02803d to your computer and use it in GitHub Desktop.
Save justinhillsjohnson/a6275753ad014c02803d to your computer and use it in GitHub Desktop.
locomotivecms-sitemap-liquid
---
title: Sitemap
slug: sitemap
is_layout: false
listed: false
published: true
cache_strategy: none
response_type: text/xml
position: 1
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in site.pages %}
{% if page.published? and page.listed? %}
{% case page.slug %}
{% when 'index' %}
<url>
<loc>http://{{ host }}</loc>
<lastmod>{{ now | date: "%F" }}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>
{% else %}
<url>
<loc>http://{{ host }}/{{ page.fullpath }}</loc>
<lastmod>{{ now | date: "%F" }}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>
{% endcase %}
{% endif %}
{% endfor %}
</urlset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment