Sidebar Navigation for Individual Sections of Site

My site is split up into two sections; “Brand Guide” and “Pattern Library”. Each section has at lease one subdirecotry. I am struggling to create a sidebar for each section, that lists the pages of just that section in order, including the subdirectory.

Ideally I’d like to turn to turn this file structure:

brand-guide
index.html.md
-01-logos.html.md
-02-colors.html.md
-03-typography.html.md
-resources
--01-web-gui.html.md
--02-further-reading.html.md
pattern-library
-index.html.md
-01-accessibility.html.md
-02-colors.html.md
-03-grid.html.md
-components
--01-buttons.html.md
--02-dialogs.html.md

Into something like this:

01 PM

Middleman NavTree looked promising but it’s inability to handle index files is a dealbreaker.

Has anyone had luck using the Sitemap to do something similar? This is close, but doesn’t return the pages in order and doesn’t display the name of the subdirectory

<div class="ui secondary vertical menu fluid nav-content-style-guide">
<% sitemap.resources.each do |page| %>
<% if page.url =~ /^(\/content-style-guide\/)/  %>
<%= link_to page.data.title, page.url, :class => "item" %>
<% end %>
<% end %>
</div>

How about managing your own list of hierarchy/files/order in a data-file? The loop in the HTML code will be straightforward and you just put necessary filenames in a YML-file. Yes, it’s not automatic, but unless you need to add/remove items frequently, this makes job done.

Just looked at the linked Middleman NavTree plugin and it also uses YML-file to define site-structure. Just reimplement the bit you need.