You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user_guide/search.rst
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,25 @@
2
2
Search bar / search button
3
3
==========================
4
4
5
-
By default, the search input field is hidden, and there is a search button
6
-
(a magnifying glass icon :fas:`search`) in the top navbar.
7
-
The search input field will be displayed when a user either:
5
+
On narrow viewports, users can access search by clicking the magnifying glass
6
+
icon (:fas:`search`) in the :ref:`layout-header`. On wide viewports, the
7
+
magnifying glass icon, search input field, and keyboard shortcut for focusing
8
+
the search input field are all shown. The keyboard shortcut is:
8
9
9
-
- Clicks the search button in the header.
10
-
- Presses the keyboard shortcut :kbd:`Ctrl` + :kbd:`K` (Linux, Windows) or :kbd:`⌘` + :kbd:`K` (macOS).
10
+
* :kbd:`Ctrl` + :kbd:`K` (Linux, Windows)
11
+
* :kbd:`⌘` + :kbd:`K` (macOS)
11
12
12
13
You can also configure some aspects of the search button and search field, described below.
13
14
14
15
Configure the search field position
15
16
-----------------------------------
16
17
17
-
The position of the search *button* is controlled by ``search-button`` and by default is included in ``html_theme_options["navbar_persistent"]``; you may move it elsewhere as befits your site's layout, or remove it.
18
-
You can also add an always-visible search field to some/all pages in your site by adding ``search-field.html`` to one of the configuration variables (e.g., ``html_sidebars``, ``html_theme_options["footer_start"]``, etc.).
18
+
The position of the search *button* is controlled by ``search-button`` and by
19
+
default is included in ``html_theme_options["navbar_persistent"]``; you may move
20
+
it elsewhere as befits your site's layout, or remove it. You can also add an
21
+
always-visible search field to some/all pages in your site by adding
22
+
``search-field.html`` to one of the configuration variables (e.g.,
For example, if you'd like the search field to be in your sidebar, add it to
21
26
the sidebar templates like so:
@@ -37,7 +42,14 @@ following configuration:
37
42
38
43
.. warning::
39
44
40
-
If a page includes *both* the search button and an always-visible search field, the keyboard shortcuts will focus on the always-visible field and the hidden search field overlay will not display. *This may not be what you want:* on small screens (i.e. mobile devices) the sidebars may be hidden in a drawer, and if the persistent search field is there, it may receive focus without actually being made visible. It is **strongly recommended** that you use *either* the search button and the hidden/overlaid field that comes with it, *or* use a persistent search field in a place that makes sense for your layout.
45
+
If a page includes *both* the search button and an always-visible search
46
+
field, the keyboard shortcuts will focus on the always-visible field and the
47
+
hidden search field overlay will not display. *This may not be what you want:*
48
+
on small screens (i.e. mobile devices) the sidebars may be hidden in a drawer,
49
+
and if the persistent search field is there, it may receive focus without
50
+
actually being made visible. It is **strongly recommended** that you use
51
+
*either* the search button and the hidden/overlaid field that comes with it,
52
+
*or* use a persistent search field in a place that makes sense for your layout.
0 commit comments