summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--content/sitemap.xml/contents.lr5
-rw-r--r--templates/base.html4
-rw-r--r--templates/sitemap.xml7
3 files changed, 16 insertions, 0 deletions
diff --git a/content/sitemap.xml/contents.lr b/content/sitemap.xml/contents.lr
new file mode 100644
index 0000000..e89ddb7
--- /dev/null
+++ b/content/sitemap.xml/contents.lr
@@ -0,0 +1,5 @@
+_template: sitemap.xml
+---
+_model: none
+---
+_discoverable: no
diff --git a/templates/base.html b/templates/base.html
index ddcaa60..ab98d2e 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -122,6 +122,10 @@
sizes="32x32"
href="{{ '/static/images/favicon.png' | asseturl }}">
<link rel="webmention" href="https://webmentions.dennisfink.me/endpoint">
+ <link rel="sitemap"
+ type="application/xml"
+ title="Sitemap"
+ href="{{ '/sitemap.xml' |url(absolute=True) }}">
{% endblock meta_links %}
<title>
{% block meta_title %}
diff --git a/templates/sitemap.xml b/templates/sitemap.xml
new file mode 100644
index 0000000..04d2a42
--- /dev/null
+++ b/templates/sitemap.xml
@@ -0,0 +1,7 @@
+<?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 %}
+ <url><loc>{{ page|url(external=true) }}</loc></url>
+ {{- loop(page.children|sort(attribute='path')) }}
+ {%- endfor %}
+</urlset>