mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: canonical urls for category and topic pages was wrong when deployed to subfolder
This commit is contained in:
parent
c7b344b00f
commit
dd0a7107a8
3 changed files with 4 additions and 4 deletions
|
@ -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_no_prefix}#{@category.url}"
|
||||
self.send(filter, category: @category.id)
|
||||
end
|
||||
|
||||
|
@ -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_no_prefix}#{@category.url}"
|
||||
self.send(filter, category: @category.id)
|
||||
end
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class TopicsController < ApplicationController
|
|||
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(@topic_view.canonical_path)
|
||||
|
||||
perform_show_response
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ module ApplicationHelper
|
|||
|
||||
opts ||= {}
|
||||
opts[:image] ||= "#{Discourse.base_url}#{SiteSetting.logo_small_url}"
|
||||
opts[:url] ||= "#{Discourse.base_url}#{request.fullpath}"
|
||||
opts[:url] ||= "#{Discourse.base_url_no_prefix}#{request.fullpath}"
|
||||
|
||||
# Use the correct scheme for open graph
|
||||
if opts[:image].present? && opts[:image].start_with?("//")
|
||||
|
|
Loading…
Reference in a new issue