<?xml version="1.0" encoding="UTF-8"?>
<urlset 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" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  {% for post in site.posts %}
    <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 %}
      <changefreq>monthly</changefreq>
      <priority>0.8</priority>
    </url>
  {% endfor %}
  
  {% for page in site.pages %}
    {% if page.layout != nil and page.layout != 'none' and page.url != '/404.html' %}
      <url>
        <loc>{{ site.url }}{{ page.url | remove: 'index.html' }}</loc>
        {% if page.date %}
          <lastmod>{{ page.date | date_to_xmlschema }}</lastmod>
        {% else %}
          <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
        {% endif %}
        <changefreq>weekly</changefreq>
        <priority>0.6</priority>
      </url>
    {% endif %}
  {% endfor %}
</urlset>
