Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for the new searchfield.html template #147

Merged
merged 1 commit into from May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/configuration.rst
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
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
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
@@ -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