From 8bd099266a4a2489ad3384797002aa5b74c966c9 Mon Sep 17 00:00:00 2001 From: Chris Holdgraf Date: Thu, 16 Jun 2022 15:46:27 +0200 Subject: [PATCH] Update pydata theme --- pyproject.toml | 4 +-- .../assets/styles/extensions/_ablog.scss | 2 +- .../styles/extensions/_readthedocs.scss | 4 +-- .../assets/styles/sections/_headers.scss | 16 ++---------- .../theme/sphinx_book_theme/layout.html | 26 ------------------- .../sections/footer-article.html | 4 +-- .../sections/sidebar-primary.html | 22 ++++++++++++++++ .../sections/sidebar-secondary.html | 1 + 8 files changed, 32 insertions(+), 47 deletions(-) create mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html create mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html diff --git a/pyproject.toml b/pyproject.toml index 6a48b27af..36c82e440 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,8 +22,8 @@ readme = "README.md" requires-python = ">=3.7" dependencies = [ - "sphinx>=3,<5", - "pydata-sphinx-theme~=0.8.0", + "sphinx>=3,<6", + "pydata-sphinx-theme~=0.9.0", "pyyaml", ] diff --git a/src/sphinx_book_theme/assets/styles/extensions/_ablog.scss b/src/sphinx_book_theme/assets/styles/extensions/_ablog.scss index b8856560b..08a2e650e 100644 --- a/src/sphinx_book_theme/assets/styles/extensions/_ablog.scss +++ b/src/sphinx_book_theme/assets/styles/extensions/_ablog.scss @@ -26,7 +26,7 @@ ul.postlist { } // Sidebar rules specifically for ABlog -div.bd-sidebar { +div.bd-sidebar-primary { h2 { font-size: 1.5em; } diff --git a/src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss b/src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss index 16ed5a1d9..74dbf1363 100644 --- a/src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss +++ b/src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss @@ -1,9 +1,9 @@ /** * ReadTheDocs pop-up menu over-rides. - * We nest everything under `.bd-sidebar` so that we use more selective + * We nest everything under `.bd-sidebar-primary` so that we use more selective * selectors than what RTD CSS uses. */ -.bd-sidebar { +.bd-sidebar-primary { // Parent container for everything else div#rtd-footer-container { position: sticky; diff --git a/src/sphinx_book_theme/assets/styles/sections/_headers.scss b/src/sphinx_book_theme/assets/styles/sections/_headers.scss index e85041587..548f73dbc 100644 --- a/src/sphinx_book_theme/assets/styles/sections/_headers.scss +++ b/src/sphinx_book_theme/assets/styles/sections/_headers.scss @@ -1,22 +1,10 @@ /** * A few different header CSS rules */ -.header-item { - width: 100%; - text-align: center; +// Remove this in the headers PR +.header-item { &:empty { display: none; } - - &.announcement { - background-color: #616161; - color: white; - padding: 0.4em 12.5%; // Horizontal padding so the width is 75% - - @media (max-width: $breakpoint-md) { - // Announcements can take a bit more width on mobile - padding: 0.4em 2%; - } - } } diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html index 37f19bce7..3ce29a602 100644 --- a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html +++ b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html @@ -16,38 +16,12 @@
Toggle in-page Table of Contents
-
- {%- include "sections/announcement.html" -%} -
{%- include "sections/header.html" -%}
{{ super() }} {% endblock %} - -{% block docs_sidebar %} - - -{% endblock %} - {% block docs_main %}
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-article.html b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-article.html index 298225eb3..1c80c8bbd 100644 --- a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-article.html +++ b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-article.html @@ -1,4 +1,4 @@ {%- if theme_show_prev_next -%} - {# stored in _templates because we inherit from the pydata theme #} - {% include "_templates/prev-next.html" %} + {# Inherited from the pydata theme #} + {% include "components/footer-article/prev-next.html" %} {%- endif -%} diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html new file mode 100644 index 000000000..df94ef09c --- /dev/null +++ b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html @@ -0,0 +1,22 @@ +{# This overrides the pydata theme sidebar template #} +{% block docs_sidebar %} + + +{% endblock %} diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html new file mode 100644 index 000000000..8abb33f06 --- /dev/null +++ b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html @@ -0,0 +1 @@ +{# Making this empty so it overrides the pydata theme #}