mirror of
https://github.com/discourse/discourse.git
synced 2025-06-25 01:01:34 +08:00
FEATURE: add override for crawler title and description tags (#32259)
In https://github.com/discourse/discourse/pull/32159 we overrode the `og:` and `twitter:` title and description but for some crawlers, we need to override the `title` and `description` meta tag as well.
This commit is contained in:
@ -270,6 +270,24 @@ module ApplicationHelper
|
||||
(request ? I18n.locale.to_s : SiteSetting.default_locale).sub("_", "-")
|
||||
end
|
||||
|
||||
def crawlable_title_content
|
||||
DiscoursePluginRegistry.apply_modifier(
|
||||
:meta_data_content,
|
||||
content_for(:title) || SiteSetting.title,
|
||||
:title,
|
||||
{ url: request.fullpath },
|
||||
)
|
||||
end
|
||||
|
||||
def crawlable_description_content
|
||||
DiscoursePluginRegistry.apply_modifier(
|
||||
:meta_data_content,
|
||||
@description_meta || SiteSetting.site_description,
|
||||
:description,
|
||||
{ url: request.fullpath },
|
||||
)
|
||||
end
|
||||
|
||||
# Creates open graph and twitter card meta data
|
||||
def crawlable_meta_data(opts = nil)
|
||||
opts ||= {}
|
||||
|
Reference in New Issue
Block a user