From 0646722928f2dd38800a113bcfc73ee7466ed9d1 Mon Sep 17 00:00:00 2001 From: Piotr Spieker Date: Fri, 15 Nov 2024 18:43:04 +0100 Subject: [PATCH] Add a auto-generated sitemap.xml --- docs/_layouts/default.html | 5 +++- docs/sitemap.xml | 59 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 docs/sitemap.xml diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index f0cad786..0b87f8ed 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -41,8 +41,11 @@

{{ page.description | default: site.description | de Cayman theme, using allejo/jekyll-toc and +
snippets from - Bram.us + Bram.us + as well as + David Ensinger ❤️ diff --git a/docs/sitemap.xml b/docs/sitemap.xml new file mode 100644 index 00000000..82c99f38 --- /dev/null +++ b/docs/sitemap.xml @@ -0,0 +1,59 @@ +--- +layout: null +sitemap: + exclude: 'yes' +permalink: /sitemap.xml +--- + + + {% for post in site.posts %} + {% assign file_ext = post.url | split: '.' | last %} + {% if post.published != false and file_ext != 'css' %} + + {{ site.url }}{{ post.url }} + {% if post.sitemap.lastmod %} + {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} + {% elsif post.date %} + {{ post.date | date_to_xmlschema }} + {% else %} + {{ site.time | date_to_xmlschema }} + {% endif %} + {% if post.sitemap.changefreq %} + {{ post.sitemap.changefreq }} + {% else %} + monthly + {% endif %} + {% if post.sitemap.priority %} + {{ post.sitemap.priority }} + {% else %} + 0.5 + {% endif %} + + {% endif %} + {% endfor %} + {% for page in site.pages %} + {% assign file_ext = page.url | split: '.' | last %} + {% if page.sitemap.exclude != "yes" and file_ext != 'css' %} + + {{ site.url }}{{ page.url | remove: "index.html" }} + {% if page.sitemap.lastmod %} + {{ page.sitemap.lastmod | date: "%Y-%m-%d" }} + {% elsif page.date %} + {{ page.date | date_to_xmlschema }} + {% else %} + {{ site.time | date_to_xmlschema }} + {% endif %} + {% if page.sitemap.changefreq %} + {{ page.sitemap.changefreq }} + {% else %} + monthly + {% endif %} + {% if page.sitemap.priority %} + {{ page.sitemap.priority }} + {% else %} + 0.3 + {% endif %} + + {% endif %} + {% endfor %} + \ No newline at end of file