Add sitemap.xml generator

This commit is contained in:
L3D 2021-02-15 00:35:18 +01:00
parent 80468e5425
commit 92fe7c5c24
No known key found for this signature in database
GPG Key ID: CD08445BFF4313D1
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,4 @@
_template: sitemap.xml
---
_model: none
_discoverable: no

9
templates/sitemap.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for page in [site.root] if page != this recursive %}
{%- if not page.hide_from_global_index %}
<url><loc>{{ page|url(external=true) }}</loc></url>
{{- loop(page.children) }}
{%- endif %}
{%- endfor %}
</urlset>