Add sitemap and robots.txt

This commit is contained in:
Wesley Moore 2010-03-11 08:04:32 +11:00
parent 99ad0e30a1
commit 221f23197a
15 changed files with 35 additions and 5 deletions

13
Rules
View file

@ -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'

View file

@ -1,2 +1,3 @@
---
title: A New Item
is_hidden: true

View file

@ -1,2 +1,3 @@
---
title: All Articles
title: All Articles
is_hidden: true

View file

@ -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

View file

@ -1,2 +1,3 @@
---
title: A New Item
is_hidden: true

View file

@ -1,2 +1,3 @@
---
title: Personal Articles
is_hidden: true

View file

@ -2,4 +2,4 @@
title: WezM.net - Personal Articles
author_name: Wesley Moore
author_uri: http://www.wezm.net/about/
is_hidden: true

6
content/robots.txt Normal file
View file

@ -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

2
content/robots.yaml Normal file
View file

@ -0,0 +1,2 @@
---
title: A New Item

1
content/sitemap.xml Normal file
View file

@ -0,0 +1 @@
<%= xml_sitemap %>

2
content/sitemap.yaml Normal file
View file

@ -0,0 +1,2 @@
---
title: A New Item

View file

@ -1,2 +1,3 @@
---
title: A New Item
is_hidden: true

View file

@ -1,2 +1,3 @@
---
title: Technical Articles
is_hidden: true

View file

@ -2,3 +2,4 @@
title: WezM.net - Technical Articles
author_name: Wesley Moore
author_uri: http://www.wezm.net/about/
is_hidden: true

View file

@ -5,4 +5,5 @@ require 'json'
include Nanoc3::Helpers::Rendering
include Nanoc3::Helpers::Blogging
include WezM::Helpers::Articles
include Nanoc3::Helpers::XMLSitemap
include WezM::Helpers::Articles