Skip to content

Commit

Permalink
Add automatic search engine integration.
Browse files Browse the repository at this point in the history
This adds the required metadata and files to support automatic search engine
additions to Chrome / Chromium.
  • Loading branch information
wting committed Oct 18, 2016
1 parent d5992d6 commit 94a7083
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions r2/r2/public/static/opensearch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>reddit search</ShortName>
<Description>Search for content on reddit!</Description>
<Url type="text/html"
method="get"
template="https://www.reddit.com/search?q={searchTerms}&amp;utm_source=opensearch"/>
</OpenSearchDescription>
1 change: 1 addition & 0 deletions r2/r2/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<meta name="description" content="${getattr(thing, 'short_description', None) or g.short_description}" />
<meta name="referrer" content="${c.referrer_policy}">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="application/opensearchdescription+xml" rel="search" href="/static/opensearch.xml"/>
<link rel="canonical" href="${thing.canonical_link}" />
%if hasattr(thing, 'mobile_link'):
<link rel="alternate" media="only screen and (max-width: 640px)" href="${thing.mobile_link}" />
Expand Down

0 comments on commit 94a7083

Please sign in to comment.