added support for disabling indexing by google using SiteSetting.allow_index_in_robots_txt = false

This commit is contained in:
Sam Saffron
2013-02-11 11:02:57 +11:00
parent 8250586306
commit c50a9e4d01
7 changed files with 54 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
class RobotsTxtController < ApplicationController
layout false
skip_before_filter :check_xhr
def index
path = if SiteSetting.allow_index_in_robots_txt && !SiteSetting.restrict_access
:index
else
:no_index
end
render path, content_type: 'text/plain'
end
end