Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1363df8

Browse files
author
s-pace
committed
adding search experience to the documentation #932
1 parent 57360cf commit 1363df8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/_templates/layout.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@
1111
min-width: initial;
1212
max-width: initial;
1313
}
14+
.algolia-autocomplete{
15+
width: 100%;
16+
height: 1.5em
17+
}
18+
#q{
19+
width: 100%;
20+
height: 100%;
21+
}
1422
</style>
23+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
24+
1525

1626
{% if pagename == 'index' %}
1727
<link rel="canonical" href="https://docs.python-guide.org/"/>
@@ -111,3 +121,12 @@
111121
{% if show_copyright %}<p>&copy;{{ copyright }}</p>{% endif %}
112122
</div>
113123
{% endblock %}
124+
<!-- at the end of the BODY -->
125+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
126+
<script type="text/javascript"> docsearch({
127+
apiKey: '512b0d6c0c8578bed7662f5279c2249c',
128+
indexName: 'python-guide',
129+
inputSelector: '#q',
130+
debug: false // Set debug to true if you want to inspect the dropdown
131+
});
132+
</script>

docs/_templates/sidebarintro.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</p>
66

77
<p style="margin-left:auto; margin-right: auto;"><iframe src="https://ghbtns.com/github-btn.html?user=realpython&repo=python-guide&type=watch&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe></p>
8+
<input placeholder="Search the doc" autofocus id="q" />
89

910
<p>
1011
This opinionated guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis.

0 commit comments

Comments
 (0)