mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Revert "Fix problem triggered by unconditional toctree call and empty toctree" (#507)
Fixes #374
This commit is contained in:
parent
894aef556e
commit
de76c03824
@ -155,18 +155,12 @@
|
||||
{%- block navigation %}
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Main') }}">
|
||||
{%- block menu %}
|
||||
{#-
|
||||
The singlehtml builder doesn't handle this toctree call when the
|
||||
toctree is empty. Skip building this for now.
|
||||
#}
|
||||
{%- if 'singlehtml' not in builder %}
|
||||
{%- set global_toc = toctree(maxdepth=theme_navigation_depth|int,
|
||||
{%- set toctree = toctree(maxdepth=theme_navigation_depth|int,
|
||||
collapse=theme_collapse_navigation|tobool,
|
||||
includehidden=theme_includehidden|tobool,
|
||||
titles_only=theme_titles_only|tobool) %}
|
||||
{%- endif %}
|
||||
{%- if global_toc %}
|
||||
{{ global_toc }}
|
||||
{%- if toctree %}
|
||||
{{ toctree }}
|
||||
{%- else %}
|
||||
<!-- Local TOC -->
|
||||
<div class="local-toc">{{ toc }}</div>
|
||||
|
@ -30,12 +30,9 @@ def test_basic():
|
||||
assert search in content
|
||||
elif isinstance(app.builder, SingleFileHTMLBuilder):
|
||||
search = (
|
||||
'<div class="local-toc"><ul>\n'
|
||||
'<ul>\n'
|
||||
'<li class="toctree-l1">'
|
||||
'<a class="reference internal" href="index.html#document-foo">foo</a>'
|
||||
'<ul>\n'
|
||||
'<li class="toctree-l2">'
|
||||
'<a class="reference internal" href="index.html#document-bar">bar</a>'
|
||||
'</li>\n'
|
||||
'</ul>'
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user