mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
Add noindex directive on unlisted topics
This commit is contained in:
parent
0bfabed2d5
commit
2f0bd6294c
@ -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}")
|
||||
|
Loading…
Reference in New Issue
Block a user