Skip to content

Commit

Permalink
Support for the new searchfield.html template
Browse files Browse the repository at this point in the history
This has been added in sphinx-doc/sphinx#11045.
  • Loading branch information
mgeier committed May 21, 2023
1 parent b756f85 commit febd5d3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ See below for `default values`_.
.. note::

This is only shown if :confval:`html_sidebars`
does *not* contain ``'searchbox.html'``.
does *not* contain ``'searchbox.html'`` or ``'searchfield.html'``.

:gh-template:`fullscreen-button.html`
A button to switch to fullscreen mode (and back again).
Expand Down Expand Up @@ -353,7 +353,8 @@ which are relevant for the ``insipid`` theme.
:file:`globaltoc.html`,
:file:`localtoc.html`,
:file:`relations.html`,
:file:`searchbox.html` and
:file:`searchbox.html`,
:file:`searchfield.html` and
:file:`sourcelink.html`.

You can also select templates from the ``insipid`` theme:
Expand Down
2 changes: 1 addition & 1 deletion doc/showcase/different-sidebar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ Search Box

If you don't like the search button in the topbar,
you can also put a search field into the sidebar
by selecting the template ``searchbox.html``.
by selecting the template ``searchbox.html`` or ``searchfield.html``.

Like the search button, this is only available when JavaScript is enabled.
2 changes: 1 addition & 1 deletion src/insipid_sphinx_theme/insipid/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
{%- endif %}
</div>
</div>
{%- if pagename != "search" and 'searchbox.html' not in sidebars %}
{%- if pagename != "search" and 'searchbox.html' not in sidebars and 'searchfield.html' not in sidebars %}
<div id="searchbox" role="search">
<form id="search-form" class="search" style="display: none" action="{{ pathto('search') }}" method="get">
<input type="search" name="q" placeholder="{{ _('Search') + ' ...' }}" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
Expand Down
2 changes: 1 addition & 1 deletion src/insipid_sphinx_theme/insipid/search-button.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- if pagename != "search" and 'searchbox.html' not in sidebars %}
{%- if pagename != "search" and 'searchbox.html' not in sidebars and 'searchfield.html' not in sidebars %}
<button id="search-button" type="button" title="{{ _('Search') }}" aria-label="{{ _('Search') }}" aria-expanded="false" aria-controls="search-form" accesskey="S">
{% include 'icons/search.svg' %}
</button>
Expand Down

0 comments on commit febd5d3

Please sign in to comment.