From f284b9ad986a33e4121eb40a0fb3106ac052a984 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 4 Nov 2026 19:08:41 +0100 Subject: Add XML sitemap generation This adds a sitemap template that recursively lists site pages and their URLs, with child pages sorted by path for consistent output. It also registers `/sitemap.xml` as a non-discoverable Lektor page and advertises the sitemap in the site's document head. --- templates/sitemap.xml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 templates/sitemap.xml (limited to 'templates/sitemap.xml') 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 @@ + + + {%- for page in [site.root] if page != this recursive %} + {{ page|url(external=true) }} + {{- loop(page.children|sort(attribute='path')) }} + {%- endfor %} + -- cgit v1.3.1