add markup for google sitelinks search box

This commit is contained in:
r888888888
2016-02-04 14:04:56 -08:00
parent 1207a39b66
commit c63d092e64
2 changed files with 27 additions and 1 deletions

View File

@@ -143,7 +143,7 @@ module PostSets
def hide_from_crawler?
return true if !is_single_tag?
return true if is_pattern_search?
return true if params[:page].to_i > 1
return true if page.to_i > 1
return true if is_metatag_search?
false
end

View File

@@ -31,6 +31,32 @@
<%= javascript_include_tag "application" %>
<%= raw Danbooru.config.custom_html_header_content %>
<%= yield :html_header %>
<% if Danbooru.config.twitter_site %>
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Organization",
"name" : "<%= Danbooru.config.app_name %>",
"url" : "http://<%= Danbooru.config.hostname%>",
"sameAs" : [
"http://twitter.com/<%= Danbooru.config.twitter_site[1..-1] %>"
]
}
</script>
<% end %>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url" : "http://<%= Danbooru.config.hostname%>",
"potentialAction": {
"@type": "SearchAction",
"target": "http://<%= Danbooru.config.hostname%>/posts?tags={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
</head>
<body lang="en">
<header id="top">