Skip to content

Commit

Permalink
Move clear search button to primary sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Jan 12, 2023
1 parent 59b2e59 commit 23074b1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@
<div class="bd-header-article">{% include "sections/header-article.html" %}</div>
{# Article content #}
{% block docs_body %}
{# This is empty and only shows up if text has been highlighted by the URL #}
{% include "components/searchbox.html" %}
<article class="bd-article" role="main">
{% block body %}{% endblock %}
</article>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% block docs_sidebar %}
{# This is empty and only shows up if text has been highlighted by the URL #}
{# We put it *both above and below the article* to be easier to find. #}
{% include "components/searchbox.html" %}

{# Header items that will be displayed in the sidebar on mobile #}
<div class="sidebar-header-items sidebar-primary__section">
{# The header center items #}
Expand Down
2 changes: 2 additions & 0 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,8 @@ def test_deprecated_build_html(sphinx_build_factory, file_regression):
file_regression.check(navbar.prettify(), basename="navbar_ix", extension=".html")

# Sidebar subpage
# This re-uses the same HTML template used above (w/o deprecated config)
# because they should still be the same.
sidebar = subpage_html.select(".bd-sidebar")[0]
file_regression.check(
sidebar.prettify(), basename="sidebar_subpage", extension=".html"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_build/sidebar_subpage.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<div class="bd-sidebar-primary bd-sidebar">
<div id="searchbox">
</div>
<div class="sidebar-header-items sidebar-primary__section">
<div class="sidebar-header-items__center">
<div class="navbar-center-item">
Expand Down

0 comments on commit 23074b1

Please sign in to comment.