mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-03 05:35:58 +00:00
docs: no third level toc on command usage pages ("Description", "Examples")
This commit is contained in:
parent
193c1850e4
commit
f6c3d1d2cc
2 changed files with 11 additions and 3 deletions
12
docs/_templates/globaltoc.html
vendored
12
docs/_templates/globaltoc.html
vendored
|
@ -1,6 +1,16 @@
|
|||
<div class="sidebar-block">
|
||||
<div class="sidebar-toc">
|
||||
{% set toctree = toctree(maxdepth=3, collapse=True, includehidden=True) %}
|
||||
{# Restrict the sidebar toc depth to two levels while generating command usage pages.
|
||||
This avoids superfluous entries for each "Description" and "Examples" heading. #}
|
||||
{% if pagename.startswith("usage/") and pagename not in (
|
||||
"usage/general", "usage/help", "usage/debug", "usage/notes",
|
||||
) %}
|
||||
{% set maxdepth = 2 %}
|
||||
{% else %}
|
||||
{% set maxdepth = 3 %}
|
||||
{% endif %}
|
||||
|
||||
{% set toctree = toctree(maxdepth=maxdepth, collapse=True) %}
|
||||
{% if toctree %}
|
||||
{{ toctree }}
|
||||
{% else %}
|
||||
|
|
|
@ -31,8 +31,6 @@ Usage
|
|||
</script>
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
usage/general
|
||||
|
||||
usage/init
|
||||
|
|
Loading…
Reference in a new issue