Skip to content

Commit 58da154

Browse files
author
Ed Costello
committed
DOCS372 add opensearch to site template, utilizing Google CSE for browser search
1 parent e0ccc41 commit 58da154

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

source/.static/osd.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
3+
<ShortName>MongoDB Help</ShortName>
4+
<LongName>Google Custom Search of MongoDB documentation and wiki</LongName>
5+
<Description>Google Custom Search of MongoDB documentation (docs.mongodb.org) and wiki (www.mongodb.org/display/DOCS)</Description>
6+
<Tags>mongodb mongo mongodocs</Tags>
7+
<Query role="example" searchTerms="mongodb"/>
8+
<Image height="16" width="16" type="image/vnd.microsoft.icon">http://media.mongodb.org/favicon.ico</Image>
9+
<Developer>10gen, inc.</Developer>
10+
<Contact>[email protected]</Contact>
11+
<Url type="text/html" rel="results" template="http://www.google.com/cse?cx=017213726194841070573:WMX6838984&amp;ie=UTF-8&amp;q={searchTerms}" />
12+
<Url type="application/opensearchdescription+xml" rel="self" template="http://docs.mongodb.org/docs/.static/osd.xml"/>
13+
<Attribution>Google Custom Search by 10Gen.com</Attribution>
14+
</OpenSearchDescription>

themes/mongodb/layout.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,10 @@
165165
{{ css() }}
166166
{%- if not embedded %}
167167
{{ script() }}
168-
{%- if use_opensearch %}
169-
<link rel="search" type="application/opensearchdescription+xml"
170-
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
171-
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
172-
{%- endif %}
168+
{%- block googlecse_opensearch %}
169+
{#- can't use Sphinx builtin opensearch, but can point to our own -#}
170+
<link rel="search" type="application/opensearchdescription+xml" href="{{ pathto('_static/osd.xml',1) }}" title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"/>
171+
{%- endblock -%}
173172
{%- if favicon %}
174173
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
175174
{%- endif %}

0 commit comments

Comments
 (0)