mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FIX: absolute canonical link on topic pages
This commit is contained in:
parent
dd93407789
commit
c7741c9622
@ -1,7 +1,9 @@
|
|||||||
require_dependency 'topic_view'
|
require_dependency 'topic_view'
|
||||||
require_dependency 'promotion'
|
require_dependency 'promotion'
|
||||||
|
require_dependency 'url_helper'
|
||||||
|
|
||||||
class TopicsController < ApplicationController
|
class TopicsController < ApplicationController
|
||||||
|
include UrlHelper
|
||||||
|
|
||||||
before_filter :ensure_logged_in, only: [:timings,
|
before_filter :ensure_logged_in, only: [:timings,
|
||||||
:destroy_timings,
|
:destroy_timings,
|
||||||
@ -57,7 +59,7 @@ class TopicsController < ApplicationController
|
|||||||
|
|
||||||
perform_show_response
|
perform_show_response
|
||||||
|
|
||||||
canonical_url @topic_view.canonical_path
|
canonical_url absolute(@topic_view.canonical_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def wordpress
|
def wordpress
|
||||||
|
@ -12,7 +12,6 @@ module CanonicalURL
|
|||||||
|
|
||||||
module Helpers
|
module Helpers
|
||||||
def canonical_link_tag(url = nil)
|
def canonical_link_tag(url = nil)
|
||||||
|
|
||||||
return '' unless url || @canonical_url
|
return '' unless url || @canonical_url
|
||||||
tag('link', rel: 'canonical', href: url || @canonical_url || request.url)
|
tag('link', rel: 'canonical', href: url || @canonical_url || request.url)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user