<?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 %}
    {% if post.url %}
      <url>
        <loc>{{ site.url | append: post.url }}</loc>
        {% if post.last_modified_at %}
          <lastmod>{{ post.last_modified_at | date_to_xmlschema }}</lastmod>
        {% elsif post.date %}
          <lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
        {% endif %}
        <changefreq>weekly</changefreq>
        <priority>0.5</priority>
      </url>
    {% endif %}
  {% endfor %}
  {% for page in site.pages %}
    {% if page.sitemap.exclude != true and page.url and page.url != "/sitemap.xml" and page.url != "/styles.css" %}
      <url>
        <loc>{{ site.url | append: page.url }}</loc>
        {% if page.last_modified_at %}
          <lastmod>{{ page.last_modified_at | date_to_xmlschema }}</lastmod>
        {% elsif page.date %}
          <lastmod>{{ page.date | date_to_xmlschema }}</lastmod>
        {% endif %}
        <changefreq>weekly</changefreq>
        <priority>0.5</priority>
      </url>
    {% endif %}
  {% endfor %}
</urlset>
