---
permalink: sitemap.xml
sitemap_exclude: 'yes'
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  {% for page in site.pages %}
    {% unless page.sitemap_exclude == "yes" or page.url contains "/404.html" %}
    <url>
      <loc>{{ page.url | remove:'index.html' | absolute_url }}</loc>
      
      {% if page.sitemap.lastmod %}
        <lastmod>{{ page.sitemap.lastmod | date: "%Y-%m-%d" }}</lastmod>
      {% elsif page.date_modified %}
        <lastmod>{{ page.date_modified | date: "%Y-%m-%d" }}</lastmod>
      {% elsif page.updated %}
        <lastmod>{{ page.updated | date: "%Y-%m-%d" }}</lastmod>
      {% elsif page.date %}
        <lastmod>{{ page.date | date_to_xmlschema }}</lastmod>
      {% endif %}

      {% if page.sitemap.changefreq %}
        <changefreq>{{ page.sitemap.changefreq }}</changefreq>
      {% else %}
        <changefreq>weekly</changefreq>
      {% endif %}

      {% if page.sitemap.priority %}
        <priority>{{ page.sitemap.priority }}</priority>
      {% elsif page.url == "/index.html" or page.url == "/" %}
        <priority>1.0</priority>
      {% elsif page.url contains "/legal/" %}
        <priority>0.2</priority>
      {% else %}
        <priority>0.6</priority>
      {% endif %}
      
    </url>
    {% endunless %}
  {% endfor %}

  {% for collection in site.collections %}
  {% assign docs = collection.docs %}
  {% for doc in docs %}
    {% unless doc.sitemap_exclude == "yes" %}
    <url>
       <loc>{{ doc.url | remove:'index.html' | absolute_url }}</loc>
      {% if doc.sitemap.lastmod %}
        <lastmod>{{ doc.sitemap.lastmod | date: "%Y-%m-%d" }}</lastmod>
      {% elsif doc.date_modified %}
        <lastmod>{{ doc.date_modified | date: "%Y-%m-%d" }}</lastmod>
      {% elsif doc.date_published %}
        <lastmod>{{ doc.date_published | date: "%Y-%m-%d" }}</lastmod>
      {% elsif doc.date %}
        <lastmod>{{ doc.date | date_to_xmlschema }}</lastmod>
      {% endif %}

      {% if doc.sitemap.changefreq %}
        <changefreq>{{ doc.sitemap.changefreq }}</changefreq>
      {% else %}
        <changefreq>weekly</changefreq>
      {% endif %}

      {% if doc.sitemap.priority %}
        <priority>{{ doc.sitemap.priority }}</priority>
      {% else %}
        <priority>0.7</priority>
      {% endif %}
    </url>
    {% endunless %}
    {% endfor %}
    {% endfor %}
</urlset>
