[docs] Improve sidebar (#12461)

- Remove "Site navigation" header
  - this is already contextually clear (especially since separators were added in #12439)
- Hide "On this page" if `display_toc is False`
- Format "On this page" header similar to top-level site-nav sections
This commit is contained in:
Chris Sewell 2024-06-22 15:32:06 +02:00 committed by GitHub
parent c5bd2d42c5
commit bcf32428c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

@ -34,12 +34,13 @@
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
{%- include "searchfield.html" %}
<div class="sphinxsidebar-navigation__contents">
<h3>{{ _('On this page') }}</h3>
{{ toc }}
</div>
{%- if display_toc %}
<div class="sphinxsidebar-navigation__contents">
<h3>{{ _('On this page') }}</h3>
{{ toc }}
</div>
{%- endif %}
<div class="sphinxsidebar-navigation__pages">
<h3>{{ _('Site navigation') }}</h3>
{{ toctree(includehidden=True, maxdepth=3, titles_only=True) }}
</div>
</div>

View File

@ -110,7 +110,8 @@ div.sphinxsidebar input {
}
div.sphinxsidebar h3 {
font-size: 1.5em;
font-size: 1.2em;
font-weight: 300;
margin-top: 0;
margin-bottom: 0.5em;
padding-top: 0.5em;