mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: output sitelinks search tag on homepage only (#16157)
Output sitelinks search tag on homepage only
This commit is contained in:
@@ -338,17 +338,19 @@ module ApplicationHelper
|
||||
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',
|
||||
if current_page?('/') || current_page?(Discourse.base_path)
|
||||
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')
|
||||
content_tag(:script, MultiJson.dump(json).html_safe, type: 'application/ld+json')
|
||||
end
|
||||
end
|
||||
|
||||
def gsub_emoji_to_unicode(str)
|
||||
|
||||
Reference in New Issue
Block a user