From 20aa8ef3a34f9785ae7df7fc524333d1eb62b7ec Mon Sep 17 00:00:00 2001 From: Jonny Gerig Meyer Date: Thu, 6 Apr 2023 14:46:54 -0400 Subject: [PATCH] Add sitemap.xml --- source/404.md | 3 ++- source/_redirects | 1 + source/feed.liquid | 2 +- source/humans.liquid | 3 ++- source/robots.liquid | 10 ++++++++++ source/robots.txt | 5 ----- source/sitemap.liquid | 18 ++++++++++++++++++ 7 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 source/robots.liquid delete mode 100644 source/robots.txt create mode 100644 source/sitemap.liquid diff --git a/source/404.md b/source/404.md index 2069493..6b2cecf 100644 --- a/source/404.md +++ b/source/404.md @@ -1,7 +1,8 @@ --- layout: has_no_sidebars title: Page Not Found -permalink: 404.html +permalink: '/404.html' +eleventyExcludeFromCollections: true introduction: > Sorry, but the page you were trying to view does not exist. center_introduction: true diff --git a/source/_redirects b/source/_redirects index 323d191..09ff367 100644 --- a/source/_redirects +++ b/source/_redirects @@ -1,4 +1,5 @@ /feed /feed.xml 200 +/sitemap /sitemap.xml 200 /tutorial /guide /download /install /try https://www.sassmeister.com diff --git a/source/feed.liquid b/source/feed.liquid index 062974d..7fa7501 100644 --- a/source/feed.liquid +++ b/source/feed.liquid @@ -1,5 +1,5 @@ --- -permalink: 'feed.xml' +permalink: '/feed.xml' eleventyExcludeFromCollections: true --- diff --git a/source/humans.liquid b/source/humans.liquid index 04ee999..72cded8 100644 --- a/source/humans.liquid +++ b/source/humans.liquid @@ -1,5 +1,6 @@ --- -permalink: humans.txt +permalink: '/humans.txt' +eleventyExcludeFromCollections: true --- # humanstxt.org/ # The humans responsible & technology colophon diff --git a/source/robots.liquid b/source/robots.liquid new file mode 100644 index 0000000..88c6343 --- /dev/null +++ b/source/robots.liquid @@ -0,0 +1,10 @@ +--- +permalink: '/robots.txt' +eleventyExcludeFromCollections: true +--- +# www.robotstxt.org/ + +# Allow crawling of all content +User-agent: * +Disallow: +Sitemap: {{ '/sitemap.xml' | absoluteUrl: site.url }} diff --git a/source/robots.txt b/source/robots.txt deleted file mode 100644 index d0e5f1b..0000000 --- a/source/robots.txt +++ /dev/null @@ -1,5 +0,0 @@ -# www.robotstxt.org/ - -# Allow crawling of all content -User-agent: * -Disallow: diff --git a/source/sitemap.liquid b/source/sitemap.liquid new file mode 100644 index 0000000..b9a57ed --- /dev/null +++ b/source/sitemap.liquid @@ -0,0 +1,18 @@ +--- +permalink: '/sitemap.xml' +eleventyExcludeFromCollections: true +--- + + + {%- assign pages = collections.all | reverse -%} + {%- for page in pages -%} + {%- if not page.data.draft %} + + {{ page.url | absoluteUrl: site.url }} + {{ page.date | dateToRfc3339 }} + {{ page.data.changefreq | default: 'monthly' }} + {{ page.data.priority | default: '0.5' }} + + {%- endif -%} + {%- endfor %} +