Commits

Georg Brandl committed 6ebe027

Fix rendering of no sidebar at all if html_sidebars entry is [].

Comments (0)

Files changed (1)

sphinx/themes/basic/layout.html

 {%- endblock %}
 {%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
 {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
+{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
+                         (not sidebars == []) %}
 
 {%- macro relbar() %}
     <div class="related">
 {%- endmacro %}
 
 {%- macro sidebar() %}
-      {%- if not embedded %}{% if not theme_nosidebar|tobool %}
+      {%- if render_sidebar %}
       <div class="sphinxsidebar">
         <div class="sphinxsidebarwrapper">
           {%- block sidebarlogo %}
             </a></p>
           {%- endif %}
           {%- endblock %}
-          {%- if sidebars %}
+          {%- if sidebars != None %}
             {#- new style sidebar: explicitly include/exclude templates #}
             {%- for sidebartemplate in sidebars %}
             {%- include sidebartemplate %}
           {%- endif %}
         </div>
       </div>
-      {%- endif %}{% endif %}
+      {%- endif %}
 {%- endmacro %}
 
 <html xmlns="http://www.w3.org/1999/xhtml">
     <div class="document">
   {%- block document %}
       <div class="documentwrapper">
-      {%- if not embedded %}{% if not theme_nosidebar|tobool %}
+      {%- if render_sidebar %}
         <div class="bodywrapper">
-      {%- endif %}{% endif %}
+      {%- endif %}
           <div class="body">
             {% block body %} {% endblock %}
           </div>
-      {%- if not embedded %}{% if not theme_nosidebar|tobool %}
+      {%- if render_sidebar %}
         </div>
-      {%- endif %}{% endif %}
+      {%- endif %}
       </div>
   {%- endblock %}