From 221f23197a80ae7679a29057f2bfdefe0d339492 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Thu, 11 Mar 2010 08:04:32 +1100 Subject: [PATCH] Add sitemap and robots.txt --- Rules | 13 ++++++++++++- content/articles/json.yaml | 1 + content/articles/page.yaml | 3 ++- content/feed.yaml | 2 +- content/personal/articles/json.yaml | 1 + content/personal/articles/page.yaml | 1 + content/personal/feed.yaml | 2 +- content/robots.txt | 6 ++++++ content/robots.yaml | 2 ++ content/sitemap.xml | 1 + content/sitemap.yaml | 2 ++ content/technical/articles/json.yaml | 1 + content/technical/articles/page.yaml | 1 + content/technical/feed.yaml | 1 + lib/default.rb | 3 ++- 15 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 content/robots.txt create mode 100644 content/robots.yaml create mode 100644 content/sitemap.xml create mode 100644 content/sitemap.yaml diff --git a/Rules b/Rules index 5b0512b..8b217b4 100644 --- a/Rules +++ b/Rules @@ -10,7 +10,7 @@ compile '*/json/' do filter :erb end -compile %r{/(technical|personal|)articles/(page/|)} do +compile %r{/(?:technical|personal|)articles/(page/|)} do filter :erb layout 'articles' end @@ -25,6 +25,10 @@ compile %r{.*/feed/} do filter :erb end +compile %r{(?:/robots/|/sitemap)} do + filter :erb +end + compile '*' do filter :rdiscount layout 'default' @@ -40,6 +44,13 @@ route %r{.*/feed/} do path.cleanpath.to_s + '.xml' end +route '/robots/' do + '/robots.txt' +end + +route '/sitemap/' do + '/sitemap.xml' +end route '*' do item.identifier + 'index.html' diff --git a/content/articles/json.yaml b/content/articles/json.yaml index e521976..c9d72bd 100644 --- a/content/articles/json.yaml +++ b/content/articles/json.yaml @@ -1,2 +1,3 @@ --- title: A New Item +is_hidden: true diff --git a/content/articles/page.yaml b/content/articles/page.yaml index 8ee7f78..b19cb3d 100644 --- a/content/articles/page.yaml +++ b/content/articles/page.yaml @@ -1,2 +1,3 @@ --- -title: All Articles \ No newline at end of file +title: All Articles +is_hidden: true diff --git a/content/feed.yaml b/content/feed.yaml index c196a86..ae062ae 100644 --- a/content/feed.yaml +++ b/content/feed.yaml @@ -3,4 +3,4 @@ title: WezM.net - All Articles author_name: Wesley Moore author_uri: http://www.wezm.net/about/ #feed_url: http://feeds.feedburner.com/wezm/ - +is_hidden: true diff --git a/content/personal/articles/json.yaml b/content/personal/articles/json.yaml index e521976..c9d72bd 100644 --- a/content/personal/articles/json.yaml +++ b/content/personal/articles/json.yaml @@ -1,2 +1,3 @@ --- title: A New Item +is_hidden: true diff --git a/content/personal/articles/page.yaml b/content/personal/articles/page.yaml index 00a6e6c..042bf5d 100644 --- a/content/personal/articles/page.yaml +++ b/content/personal/articles/page.yaml @@ -1,2 +1,3 @@ --- title: Personal Articles +is_hidden: true diff --git a/content/personal/feed.yaml b/content/personal/feed.yaml index e46eaf4..8bda377 100644 --- a/content/personal/feed.yaml +++ b/content/personal/feed.yaml @@ -2,4 +2,4 @@ title: WezM.net - Personal Articles author_name: Wesley Moore author_uri: http://www.wezm.net/about/ - +is_hidden: true diff --git a/content/robots.txt b/content/robots.txt new file mode 100644 index 0000000..f7406f3 --- /dev/null +++ b/content/robots.txt @@ -0,0 +1,6 @@ +# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +User-Agent: * +Disallow: +Sitemap: <%= @site.config[:base_url] %>/sitemap.xml diff --git a/content/robots.yaml b/content/robots.yaml new file mode 100644 index 0000000..e521976 --- /dev/null +++ b/content/robots.yaml @@ -0,0 +1,2 @@ +--- +title: A New Item diff --git a/content/sitemap.xml b/content/sitemap.xml new file mode 100644 index 0000000..63691eb --- /dev/null +++ b/content/sitemap.xml @@ -0,0 +1 @@ +<%= xml_sitemap %> diff --git a/content/sitemap.yaml b/content/sitemap.yaml new file mode 100644 index 0000000..e521976 --- /dev/null +++ b/content/sitemap.yaml @@ -0,0 +1,2 @@ +--- +title: A New Item diff --git a/content/technical/articles/json.yaml b/content/technical/articles/json.yaml index e521976..c9d72bd 100644 --- a/content/technical/articles/json.yaml +++ b/content/technical/articles/json.yaml @@ -1,2 +1,3 @@ --- title: A New Item +is_hidden: true diff --git a/content/technical/articles/page.yaml b/content/technical/articles/page.yaml index e34d3af..4ab9743 100644 --- a/content/technical/articles/page.yaml +++ b/content/technical/articles/page.yaml @@ -1,2 +1,3 @@ --- title: Technical Articles +is_hidden: true diff --git a/content/technical/feed.yaml b/content/technical/feed.yaml index 1ce0bd4..ba1a35d 100644 --- a/content/technical/feed.yaml +++ b/content/technical/feed.yaml @@ -2,3 +2,4 @@ title: WezM.net - Technical Articles author_name: Wesley Moore author_uri: http://www.wezm.net/about/ +is_hidden: true diff --git a/lib/default.rb b/lib/default.rb index f252f08..07d9409 100644 --- a/lib/default.rb +++ b/lib/default.rb @@ -5,4 +5,5 @@ require 'json' include Nanoc3::Helpers::Rendering include Nanoc3::Helpers::Blogging -include WezM::Helpers::Articles \ No newline at end of file +include Nanoc3::Helpers::XMLSitemap +include WezM::Helpers::Articles