{% block sphinxsidebar %}
  <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
    <div class="sphinxsidebarwrapper">
      {% set toctree = toctree(maxdepth=theme_globaltoc_depth|int, includehidden=True) %}
      {% if toctree %}
        {{ toctree }}
      {% else %}
        <!-- Local TOC -->
        <div class="local-toc">{{ toc }}</div>
      {% endif %}
    </div>
  </div>
{% endblock  %}
