{% block menu %}
  {% if 'singlehtml' not in builder %}
    {% set global_toc = toctree(maxdepth=theme_navigation_depth|int, collapse=theme_collapse_navigation, includehidden=True) %}
  {% endif %}
  {% if global_toc %}
    {{ global_toc }}
  {% else %}
    <div class="local-toc">{{ toc }}</div>
  {% endif %}
{% endblock %}