Add noindex directive on unlisted topics

This commit is contained in:
Kane York 2015-06-22 11:00:39 -07:00
parent 0bfabed2d5
commit 2f0bd6294c

View File

@ -77,6 +77,10 @@ class TopicsController < ApplicationController
@topic_view.draft = Draft.get(current_user, @topic_view.draft_key, @topic_view.draft_sequence)
end
unless @topic_view.topic.visible
response.headers['X-Robots-Tag'] = 'noindex'
end
perform_show_response
canonical_url UrlHelper.absolute_without_cdn("#{Discourse.base_uri}#{@topic_view.canonical_path}")