Add sitemap.xml

This commit is contained in:
Mathias Bynens
2018-09-24 15:09:15 -04:00
parent 4a517aecc1
commit 096ff9f3de
5 changed files with 26 additions and 2 deletions

16
sitemap.xml.njk Normal file
View File

@@ -0,0 +1,16 @@
---
permalink: /sitemap.xml
excludeFromSitemap: true
---
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for page in collections.all %}
{%- if not page.data.excludeFromSitemap %}
{% set absoluteUrl %}{{ page.url | url | absoluteUrl(metadata.url) }}{% endset %}
<url>
<loc>{{ absoluteUrl }}</loc>
<lastmod>{{ page.date | htmlDateString }}</lastmod>
</url>
{%- endif %}
{%- endfor %}
</urlset>