discourse/app/controllers/robots_txt_controller.rb

16 lines
347 B
Ruby
Raw Normal View History

class RobotsTxtController < ApplicationController
layout false
skip_before_filter :check_xhr
2013-02-11 14:14:36 +08:00
skip_before_filter :check_restricted_access
def index
path = if SiteSetting.allow_index_in_robots_txt && SiteSetting.access_password.blank?
:index
else
:no_index
end
2013-02-26 00:42:20 +08:00
render path, content_type: 'text/plain'
end
end