From 18869703636a5af33cc224bf7e6662fba7b03fc3 Mon Sep 17 00:00:00 2001 From: HackerNCoder Date: Wed, 31 Jan 2024 21:16:35 +0100 Subject: [PATCH] Add sitemap and robots.txt --- assets/robots.txt | 4 ++++ comlib.lektorproject | 1 + content/sitemap.xml/contents.lr | 3 +++ templates/sitemap.xml | 7 +++++++ 4 files changed, 15 insertions(+) create mode 100644 assets/robots.txt create mode 100644 content/sitemap.xml/contents.lr create mode 100644 templates/sitemap.xml diff --git a/assets/robots.txt b/assets/robots.txt new file mode 100644 index 0000000..72ec76f --- /dev/null +++ b/assets/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: /lib/ + +Sitemap: https://comlib.encryptionin.space/sitemap.xml diff --git a/comlib.lektorproject b/comlib.lektorproject index b285873..784fb4a 100644 --- a/comlib.lektorproject +++ b/comlib.lektorproject @@ -1,2 +1,3 @@ [project] name = comlib +url = https://comlib.encryptionin.space/ diff --git a/content/sitemap.xml/contents.lr b/content/sitemap.xml/contents.lr new file mode 100644 index 0000000..ea42d08 --- /dev/null +++ b/content/sitemap.xml/contents.lr @@ -0,0 +1,3 @@ +_template: sitemap.xml +--- +_model: none 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 %} +