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:
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>