From 5e446bd62e2bb7e54b6e08ebad48c327e09c50f2 Mon Sep 17 00:00:00 2001 From: Sungchan Yi Date: Sat, 8 Jul 2023 09:51:43 +0900 Subject: [PATCH] feat: sitemap and robots --- robots.txt | 3 +++ sitemap.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 robots.txt create mode 100644 sitemap.xml diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..3a34f55 --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +Sitemap: https://blog.zxcvber.com/sitemap.xml diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..aaaecf4 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,28 @@ +--- +layout: null +--- + + + {% for post in site.posts %} + + {{ site.url }}{{ post.url }} + {% if post.last_modified_at == null %} + {{ post.date | date_to_xmlschema }} + {% else %} + {{ post.last_modified_at | date_to_xmlschema }} + {% endif %} + + {% if post.sitemap.changefreq == null %} + weekly + {% else %} + {{ post.sitemap.changefreq }} + {% endif %} + + {% if post.sitemap.priority == null %} + 0.5 + {% else %} + {{ post.sitemap.priority }} + {% endif %} + + {% endfor %} +