diff --git a/_layouts/minimal.html b/_layouts/minimal.html
index f355efd68a30c69607c1f0b0e6c0fd3ec8f77f65..5c70640461020cb3a8ec9593191763ecc8c3857d 100644
--- a/_layouts/minimal.html
+++ b/_layouts/minimal.html
@@ -16,24 +16,25 @@ layout: table_wrappers
     </symbol>
   </svg>
 
+  {% capture nav %}
+    {% if site.just_the_docs.collections %}
+      {% assign collections_size = site.just_the_docs.collections | size %}
+      {% for collection_entry in site.just_the_docs.collections %}
+        {% assign collection_key = collection_entry[0] %}
+        {% assign collection_value = collection_entry[1] %}
+        {% assign collection = site[collection_key] %}
+        {% if collection_value.nav_exclude != true %}
+          {% include nav.html pages=collection %}
+        {% endif %}
+      {% endfor %}
+    {% else %}
+      {% include nav.html pages=site.html_pages %}
+    {% endif %}
+  {% endcapture %}
+
   <div id="main-content-wrap" class="main-content-wrap">
     {% unless page.url == "/" %}
       {% if page.parent %}
-        {% capture nav %}
-          {% if site.just_the_docs.collections %}
-            {% assign collections_size = site.just_the_docs.collections | size %}
-            {% for collection_entry in site.just_the_docs.collections %}
-              {% assign collection_key = collection_entry[0] %}
-              {% assign collection_value = collection_entry[1] %}
-              {% assign collection = site[collection_key] %}
-              {% if collection_value.nav_exclude != true %}
-                {% include nav.html pages=collection %}
-              {% endif %}
-            {% endfor %}
-          {% else %}
-            {% include nav.html pages=site.html_pages %}
-          {% endif %}
-        {% endcapture %}
         {%- for node in pages_list -%}
           {%- if node.parent == nil -%}
             {%- if page.parent == node.title or page.grand_parent == node.title -%}