Skip to content

Commit

Permalink
[docs] Improve sidebar (#12461)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
chrisjsewell authored Jun 22, 2024
1 parent c5bd2d4 commit bcf3242
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions doc/_themes/sphinx13/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ <h3>{{ _('Navigation') }}</h3>
<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>
Expand Down
3 changes: 2 additions & 1 deletion doc/_themes/sphinx13/static/sphinx13.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bcf3242

Please sign in to comment.