From c555b45bd2e04e30294e0d01d53b49153f162cb2 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 23 Jan 2014 12:53:33 +0200 Subject: [PATCH 1/3] Generate sitemap.xml and add robots.txt. --- _config.yml | 1 + robots.txt | 10 ++++++++++ sitemap.xml | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 robots.txt create mode 100644 sitemap.xml diff --git a/_config.yml b/_config.yml index fa6bc0a..5c400ae 100644 --- a/_config.yml +++ b/_config.yml @@ -2,6 +2,7 @@ title: ChooseALicense.com relative_permalinks: false markdown: kramdown +url: "http://choosealicense.com" rules: diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..3f86d8a --- /dev/null +++ b/robots.txt @@ -0,0 +1,10 @@ +--- +layout: nil +--- + +# www.robotstxt.org/ + +# Allow crawling of all content +User-agent: * +Disallow: +Sitemap: {{ site.url }}/sitemap.xml diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..0000433 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,29 @@ +--- +layout: nil +--- + + + + + {{ site.url }}/ + {{ site.time | date_to_xmlschema }} + daily + 1.0 + + {% for page in site.pages %} + + {{ site.url }}{{ page.url }} + {{ site.time | date_to_xmlschema }} + weekly + 0.7 + + {% endfor %} + {% for post in site.posts %} + + {{ site.url }}{{ post.url }} + {{ post.date | date_to_xmlschema }} + weekly + 0.8 + + {% endfor %} + From 6211c56b682610fd985a87fc8942a18e33b85862 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 24 Jan 2014 08:25:40 +0200 Subject: [PATCH 2/3] index.html: specify permalink. This way we don't get `http://choosealicense.com/index.html` in sitemap. --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 607f5b2..517ec71 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ class: home hide_breadcrumbs: true title: Choosing an OSS license doesn’t need to be scary description: A site to provide non-judgmental guidance on choosing a license for your open source project +permalink: / ---

From 1e24124ddc3b59b7d651bc4431a2f2deda1fda8b Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 24 Jan 2014 08:40:39 +0200 Subject: [PATCH 3/3] sitemap.xml: exclude pages with layout: nil. --- sitemap.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sitemap.xml b/sitemap.xml index 0000433..1322dcd 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -11,12 +11,14 @@ layout: nil 1.0 {% for page in site.pages %} + {% if page.layout != "nil" %} {{ site.url }}{{ page.url }} {{ site.time | date_to_xmlschema }} weekly 0.7 + {% endif %} {% endfor %} {% for post in site.posts %}