Skip to content

Commit deeba14

Browse files
committed
searchbox.html: Use docsearch instead of default
This template overrides the default searchbox.html template shipped with sphinx hence, allowing usage of custom search like DocSearch. Closes #463
1 parent 3031adf commit deeba14

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

_templates/searchbox.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{%- if pagename != "search" and builder != "singlehtml" %}
2+
<div id="searchbox" style="display: none" role="search">
3+
<h3>{{ _('Quick Search') }}</h3>
4+
<div><input type="text" name="q"/></div>
5+
</div>
6+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
7+
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
8+
<script type="text/javascript">
9+
$('#searchbox').show(0);
10+
docsearch({
11+
apiKey: '4332f80999581036b1bf34e7aa9a2940',
12+
indexName: 'coala',
13+
inputSelector: '#searchbox > div > input',
14+
debug: false // Set debug to true if you want to inspect the dropdown
15+
});
16+
</script>
17+
18+
{%- endif %}

0 commit comments

Comments
 (0)