Skip to content

Commit c9f2806

Browse files
committed
add option to modify search behaviour
1 parent 2ca32b7 commit c9f2806

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
<form class="bd-search d-flex align-items-center" action="https://www.pymc.io/search.html" method="get">
1+
{# A bootstrap-styled field that will direct to the `search.html` page when submitted #}
2+
{# It is copied over from pydata-sphinx-theme to hijack the search bar in readthedocs subprojects to search over all subprojects like in main website #}
3+
4+
{% if theme_use_search_override %}
5+
<form class="bd-search d-flex align-items-center"
6+
action="https://www.pymc.io/search.html"
7+
method="get">
8+
{% else %}
9+
<form class="bd-search d-flex align-items-center"
10+
action="{{ pathto('search') }}"
11+
method="get">
12+
{% endif %}
213
<i class="fa-solid fa-magnifying-glass"></i>
3-
<input type="search" class="form-control" name="q" id="search-input" placeholder="{{ _(theme_search_bar_text) }}" aria-label="{{ theme_search_bar_text }}" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
14+
<input type="search"
15+
class="form-control"
16+
name="q"
17+
id="search-input"
18+
placeholder="{{ _(theme_search_bar_text) }}"
19+
aria-label="{{ theme_search_bar_text }}"
20+
autocomplete="off"
21+
autocorrect="off"
22+
autocapitalize="off"
23+
spellcheck="false"/>
424
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
525
</form>

src/pymc_sphinx_theme/theme.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ inherit = pydata_sphinx_theme
33
stylesheet = css/style.css
44

55
[options]
6+
use_search_override = True
7+
# Inherited options with custom defaults
68
show_prev_next = False
79
navbar_start = navbar-logo.html, navbar-version.html
810
navbar_end = pymc_icon_links.html

0 commit comments

Comments
 (0)