From bc10887eafbea65026eb9e42f7de4cda69af2883 Mon Sep 17 00:00:00 2001 From: hollis Date: Mon, 18 Mar 2024 10:01:12 +1030 Subject: [PATCH] add sitemap xml --- src/robots.txt | 2 ++ src/sitemap.njk | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/sitemap.njk diff --git a/src/robots.txt b/src/robots.txt index 150140e..48fa093 100644 --- a/src/robots.txt +++ b/src/robots.txt @@ -1,3 +1,5 @@ +Sitemap: https://www.belter.io/sitemap.xml + User-agent: GPTBot User-agent: ChatGPT-User User-agent: Google-Extended diff --git a/src/sitemap.njk b/src/sitemap.njk new file mode 100644 index 0000000..cf17bf7 --- /dev/null +++ b/src/sitemap.njk @@ -0,0 +1,16 @@ +--- +permalink: /sitemap.xml +eleventyExcludeFromCollections: true +--- + + + {% for page in collections.all %} + {% if not page.data.draft %} + + {{ site.url }}{{ page.url | url }} + {{ page.date.toISOString() }} + {{ page.data.changeFreq if page.data.changeFreq else "monthly" }} + + {% endif %} + {% endfor %} + \ No newline at end of file