mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 06:56:01 +08:00
Merge pull request #4010 from riking/patch-sitelinks
FEATURE: Add /search discovery
This commit is contained in:
@ -157,6 +157,20 @@ module ApplicationHelper
|
||||
result.join("\n")
|
||||
end
|
||||
|
||||
def render_sitelinks_search_tag
|
||||
json = {
|
||||
'@context': 'http://schema.org',
|
||||
'@type': 'WebSite',
|
||||
url: Discourse.base_url,
|
||||
potentialAction: {
|
||||
'@type': 'SearchAction',
|
||||
target: "#{Discourse.base_url}/search?q={search_term_string}",
|
||||
'query-input': 'required name=search_term_string',
|
||||
}
|
||||
}
|
||||
content_tag(:script, MultiJson.dump(json).html_safe, type: 'application/ld+json'.freeze)
|
||||
end
|
||||
|
||||
def application_logo_url
|
||||
@application_logo_url ||= (mobile_view? && SiteSetting.mobile_logo_url) || SiteSetting.logo_url
|
||||
end
|
||||
|
Reference in New Issue
Block a user