Skip to content

Commit

Permalink
Improved robots.txt, added support for humans.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
battlehorse committed May 18, 2011
1 parent b52b2e9 commit 0dceaa6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/sitemap_controller.rb
Expand Up @@ -14,6 +14,10 @@ def robots # for robots.txt
render :layout => false, :content_type => "text/plain"
end

def humans # for humans.txt
render :layout => false, :content_type => "text/plain"
end

def sitemap # for sitemap.xml
# Priorities explained:
# 1.0 : Home
Expand Down
1 change: 1 addition & 0 deletions app/views/shared/layout/_head.html.erb
Expand Up @@ -4,6 +4,7 @@
<meta name="Distribution" content="Global" />
<meta name="Author" content="<%= borg(:meta)[:author] %>" />
<meta name="Robots" content="<%= borg(:meta)[:robots] %>" />
<link type="text/plain" rel="author" href="<%= url_for root_path %>humans.txt" />
<%= csrf_meta_tag %>
<% if @mobile -%>
<meta name="viewport" content="width=device-width" />
Expand Down
1 change: 1 addition & 0 deletions app/views/sitemap/humans.erb
@@ -0,0 +1 @@
<%= borg(:humans_txt) %>
3 changes: 3 additions & 0 deletions app/views/sitemap/robots.erb
@@ -1 +1,4 @@
User-agent: *
Disallow:

Sitemap: <%= url_for :controller => "sitemap", :action => "sitemap", :only_path => false %>
1 change: 1 addition & 0 deletions config/routes.rb
Expand Up @@ -26,6 +26,7 @@

# Single files
match 'robots.txt' => 'sitemap#robots'
match 'humans.txt' => 'sitemap#humans'
match 'sitemap.xml' => 'sitemap#sitemap'

# Social buttons
Expand Down

0 comments on commit 0dceaa6

Please sign in to comment.