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 %}
|
{%- block navigation %}
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Main') }}">
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Main') }}">
|
||||||
{%- block menu %}
|
{%- block menu %}
|
||||||
{#-
|
{%- set toctree = toctree(maxdepth=theme_navigation_depth|int,
|
||||||
The singlehtml builder doesn't handle this toctree call when the
|
collapse=theme_collapse_navigation|tobool,
|
||||||
toctree is empty. Skip building this for now.
|
includehidden=theme_includehidden|tobool,
|
||||||
#}
|
titles_only=theme_titles_only|tobool) %}
|
||||||
{%- if 'singlehtml' not in builder %}
|
{%- if toctree %}
|
||||||
{%- set global_toc = toctree(maxdepth=theme_navigation_depth|int,
|
{{ toctree }}
|
||||||
collapse=theme_collapse_navigation|tobool,
|
|
||||||
includehidden=theme_includehidden|tobool,
|
|
||||||
titles_only=theme_titles_only|tobool) %}
|
|
||||||
{%- endif %}
|
|
||||||
{%- if global_toc %}
|
|
||||||
{{ global_toc }}
|
|
||||||
{%- else %}
|
{%- else %}
|
||||||
<!-- Local TOC -->
|
<!-- Local TOC -->
|
||||||
<div class="local-toc">{{ toc }}</div>
|
<div class="local-toc">{{ toc }}</div>
|
||||||
|
@ -30,12 +30,9 @@ def test_basic():
|
|||||||
assert search in content
|
assert search in content
|
||||||
elif isinstance(app.builder, SingleFileHTMLBuilder):
|
elif isinstance(app.builder, SingleFileHTMLBuilder):
|
||||||
search = (
|
search = (
|
||||||
'<div class="local-toc"><ul>\n'
|
'<ul>\n'
|
||||||
'<li class="toctree-l1">'
|
'<li class="toctree-l1">'
|
||||||
'<a class="reference internal" href="index.html#document-foo">foo</a>'
|
'<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'
|
'</li>\n'
|
||||||
'</ul>'
|
'</ul>'
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user