From 5a9ff07b652089f1e783b93a189b2f96d3722eac Mon Sep 17 00:00:00 2001 From: Kevin Lin <kevinl@cs.uw.edu> Date: Tue, 23 Feb 2021 10:18:01 -0800 Subject: [PATCH] _layouts: Compute pages_list for minimal.html toc --- _layouts/minimal.html | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/_layouts/minimal.html b/_layouts/minimal.html index f355efd..5c70640 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 -%} -- GitLab