mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
added support for disabling indexing by google using SiteSetting.allow_index_in_robots_txt = false
This commit is contained in:
14
app/controllers/robots_txt_controller.rb
Normal file
14
app/controllers/robots_txt_controller.rb
Normal 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
|
||||
Reference in New Issue
Block a user