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:
Rafael dos Santos Silva
2022-04-19 18:24:38 -03:00
committed by GitHub
parent 39cb9f105f
commit 9d5241d347
2 changed files with 10 additions and 0 deletions

View File

@ -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