mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: allow search engines to index tag pages. (#12248)
Previously, we blocked search engines in tag pages since they may get marked as a duplicate content. * DEV: block tag inner pages from search engines crawling.
This commit is contained in:
@@ -23,7 +23,7 @@ class RobotsTxtController < ApplicationController
|
|||||||
/u
|
/u
|
||||||
/my
|
/my
|
||||||
/search
|
/search
|
||||||
/tag
|
/tag/*/l
|
||||||
/g
|
/g
|
||||||
/t/*/*.rss
|
/t/*/*.rss
|
||||||
/c/*.rss
|
/c/*.rss
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class TagsController < ::ApplicationController
|
|||||||
|
|
||||||
before_action :fetch_tag, only: [:info, :create_synonyms, :destroy_synonym]
|
before_action :fetch_tag, only: [:info, :create_synonyms, :destroy_synonym]
|
||||||
|
|
||||||
after_action :add_noindex_header
|
after_action :add_noindex_header, except: [:index, :show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@description_meta = I18n.t("tags.title")
|
@description_meta = I18n.t("tags.title")
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ describe TagsController do
|
|||||||
tags = response.parsed_body["tags"]
|
tags = response.parsed_body["tags"]
|
||||||
expect(tags.length).to eq(1)
|
expect(tags.length).to eq(1)
|
||||||
expect(tags[0]['text']).to eq("topic-test")
|
expect(tags[0]['text']).to eq("topic-test")
|
||||||
expect(response.headers['X-Robots-Tag']).to eq('noindex')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user