Skip to content

Commit 23074b1

Browse files
committed
Move clear search button to primary sidebar
1 parent 59b2e59 commit 23074b1

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@
8989
<div class="bd-header-article">{% include "sections/header-article.html" %}</div>
9090
{# Article content #}
9191
{% block docs_body %}
92-
{# This is empty and only shows up if text has been highlighted by the URL #}
93-
{% include "components/searchbox.html" %}
9492
<article class="bd-article" role="main">
9593
{% block body %}{% endblock %}
9694
</article>

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/sections/sidebar-primary.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{% block docs_sidebar %}
2+
{# This is empty and only shows up if text has been highlighted by the URL #}
3+
{# We put it *both above and below the article* to be easier to find. #}
4+
{% include "components/searchbox.html" %}
5+
26
{# Header items that will be displayed in the sidebar on mobile #}
37
<div class="sidebar-header-items sidebar-primary__section">
48
{# The header center items #}

tests/test_build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,8 @@ def test_deprecated_build_html(sphinx_build_factory, file_regression):
765765
file_regression.check(navbar.prettify(), basename="navbar_ix", extension=".html")
766766

767767
# Sidebar subpage
768+
# This re-uses the same HTML template used above (w/o deprecated config)
769+
# because they should still be the same.
768770
sidebar = subpage_html.select(".bd-sidebar")[0]
769771
file_regression.check(
770772
sidebar.prettify(), basename="sidebar_subpage", extension=".html"

tests/test_build/sidebar_subpage.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<div class="bd-sidebar-primary bd-sidebar">
2+
<div id="searchbox">
3+
</div>
24
<div class="sidebar-header-items sidebar-primary__section">
35
<div class="sidebar-header-items__center">
46
<div class="navbar-center-item">

0 commit comments

Comments
 (0)