Skip to content

Commit 0f56595

Browse files
committed
Merge pull request coderwall#243 from nicolasiensen/bounties/415
Add Google's sitelinks search box support #415
2 parents c18713c + c894496 commit 0f56595

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

app/views/layouts/home4-layout.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
%meta{ name: 'google', value: 'notranslate' }
1010
= render partial: 'shared/analytics'
1111
= render partial: 'shared/mixpanel'
12+
= render partial: 'shared/schema.org'
1213

1314
%meta{ name: 'twitter:account_id', content: ENV['TWITTER_ACCOUNT_ID'] }
1415
= metamagic

app/views/shared/_schema.org.html.erb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- schema.org markup for Google Search integration (https://developers.google.com/webmasters/richsnippets/sitelinkssearch?utm_source=wmc-blog&utm_medium=direct-referral&utm_campaign=sitelinks-searchbox) -->
2+
3+
<script type="application/ld+json">
4+
{
5+
"@context": "http://schema.org",
6+
"@type": "WebSite",
7+
"url": "<%= root_url %>",
8+
"potentialAction": {
9+
"@type": "SearchAction",
10+
"target": "<%= raw search_protips_url(scope: "everything") %>&search={search_term_string}",
11+
"query-input": "required name=search_term_string"
12+
}
13+
}
14+
</script>

0 commit comments

Comments
 (0)