mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Block indexing the embed topic list (#16495)
This adds a robots tag header to disallow indexing the topic list that powers our embed topic list feature. It also uses a new tag that allows the content to be indexed in the parent page. See https://developers.google.com/search/blog/2022/01/robots-meta-tag-indexifembedded https://meta.discourse.org/t/-/125911/127
This commit is contained in:

committed by
GitHub

parent
39cb9f105f
commit
9d5241d347
@ -35,6 +35,8 @@ class EmbedController < ApplicationController
|
||||
raise Discourse::InvalidParameters.new(:embed_class) unless @embed_class =~ /^[a-zA-Z0-9\-_]+$/
|
||||
end
|
||||
|
||||
response.headers['X-Robots-Tag'] = 'noindex, indexifembedded'
|
||||
|
||||
if params.has_key?(:template) && params[:template] == "complete"
|
||||
@template = "complete"
|
||||
else
|
||||
|
Reference in New Issue
Block a user