first attempt to implement a "jump to top" anchor in the sidebar

This commit is contained in:
Axel Kohlmeyer
2025-03-21 19:30:28 -04:00
parent ee78e3e201
commit 3834169c92

View File

@ -137,6 +137,7 @@
{# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #}
{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
{%- set _root_doc = root_doc|default(master_doc) %}
<div id="sidebar-top-target"></div>
<a href="{{ pathto(_root_doc) }}"{% if not theme_logo_only %} class="icon icon-home"{% endif %}>
{% if not theme_logo_only %}{{ project }}{% endif %}
{%- if logo or logo_url %}
@ -172,6 +173,11 @@
</div>
{%- endblock %}
</div>
<div style="padding: 4px;">
<center>
<a href="#sidebar-top-target"><img src="_static/up.png" alt="(Up)"/> Go to top</a>
</center>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">