From d3c81948307589e83b75332d16e8a32f8ac47b08 Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Fri, 4 Oct 2024 17:33:50 +0200 Subject: [PATCH] fix: scrolltop button --- src/sphinxawesome_theme/layout.html | 7 ++++- src/sphinxawesome_theme/scrolltop.html | 9 ++++-- src/sphinxawesome_theme/static/theme.css | 2 +- tests/test_scrolltop.py | 40 ++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 tests/test_scrolltop.py diff --git a/src/sphinxawesome_theme/layout.html b/src/sphinxawesome_theme/layout.html index 4fbd03753..c6ce1d068 100644 --- a/src/sphinxawesome_theme/layout.html +++ b/src/sphinxawesome_theme/layout.html @@ -84,7 +84,9 @@ {%- block extrahead %}{%- endblock extrahead %} - + {#- A blurry background screen for the mobile sidebar -#} {%- if sidebars|length > 0 %} @@ -131,6 +133,9 @@ {%- include "footer.html" %} {%- endblock footer %} + {%- if theme_show_scrolltop|tobool %} + {%- include "scrolltop.html" %} + {%- endif %} {% block scripts %} {%- for js in script_files %} {{ js_tag(js) }} diff --git a/src/sphinxawesome_theme/scrolltop.html b/src/sphinxawesome_theme/scrolltop.html index f86d4e02c..c9d178a21 100644 --- a/src/sphinxawesome_theme/scrolltop.html +++ b/src/sphinxawesome_theme/scrolltop.html @@ -1,9 +1,12 @@ {#- A `scroll to top` button. Is shown at the bottom right if `show_scrolltop` is true. -#} -