--- layout: compress # The Sitemap template # v2.0 # https://github.com/cotes2020/jekyll-theme-chirpy # © 2017-2019 Cotes Chung # MIT License --- {% for post in site.posts %} {% unless post.published == false %} {% capture lastmod %} {% if post.seo.date_modified %} {{ post.seo.date_modified }} {% elsif post.date %} {{ post.date }} {% else %} {{ site.time }} {% endif %} {% endcapture %} {{ site.url | append: site.baseurl | append: post.url }} {{ lastmod | date_to_xmlschema }} {% if post.sitemap.changefreq %} {{ post.sitemap.changefreq }} {% else %} monthly {% endif %} {% if post.sitemap.priority %} {{ post.sitemap.priority }} {% else %} 0.5 {% endif %} {% endunless %} {% endfor %} {% for page in site.pages %} {% assign pass = false %} {% for fuzzy in site.sitemap_exclude.fuzzy %} {% if page.url contains fuzzy %} {% assign pass = true %} {% break %} {% endif %} {% endfor %} {% unless pass %} {% for accurate in site.sitemap_exclude.accurate %} {% assign len = accurate | size %} {% capture beg %}{{ 0 | minus: len }}{% endcapture %} {% capture tail %}{{ page.url | slice: beg, len }}{% endcapture %} {% if tail == accurate %} {% assign pass = true %} {% break %} {% endif %} {% endfor %} {% endunless %} {% if pass %} {% continue %} {% endif %} {% capture lastmod %} {% if page.lastmod %} {{ page.lastmod }} {% elsif page.date %} {{ page.date }} {% else %} {{ site.time }} {% endif %} {% endcapture %} {{ site.url | append: site.baseurl | append: page.url | remove: "index.html" }} {{ lastmod | date_to_xmlschema }} {% if page.sitemap.changefreq %} {{ page.sitemap.changefreq }} {% else %} monthly {% endif %} {% if page.sitemap.priority %} {{ page.sitemap.priority }} {% else %} 0.3 {% endif %} {% endfor %}