Skip to content

Commit

Permalink
FIX: paginated category and topic pages should not have canonical tag
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitjalan committed Sep 29, 2015
1 parent 083bdcc commit ecd93f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/list_controller.rb
Expand Up @@ -84,7 +84,7 @@ class ListController < ApplicationController
end

define_method("category_#{filter}") do
canonical_url "#{Discourse.base_url}#{@category.url}"
canonical_url "#{Discourse.base_url}#{@category.url}" unless params[:page].present?
self.send(filter, category: @category.id)
end

Expand All @@ -93,7 +93,7 @@ class ListController < ApplicationController
end

define_method("parent_category_category_#{filter}") do
canonical_url "#{Discourse.base_url}#{@category.url}"
canonical_url "#{Discourse.base_url}#{@category.url}" unless params[:page].present?
self.send(filter, category: @category.id)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/topics_controller.rb
Expand Up @@ -83,7 +83,7 @@ def show
response.headers['X-Robots-Tag'] = 'noindex'
end

canonical_url UrlHelper.absolute_without_cdn("#{Discourse.base_uri}#{@topic_view.canonical_path}")
canonical_url UrlHelper.absolute_without_cdn("#{Discourse.base_uri}#{@topic_view.canonical_path}") unless params[:page].present?

perform_show_response

Expand Down

0 comments on commit ecd93f7

Please sign in to comment.