bryanbraun / middleman-navtree

For building navigation trees & menus in Middleman.
MIT License
45 stars 17 forks source link

sort_folders_navtree option for folders and files at the same file level #17

Closed jaredmorgs closed 7 years ago

jaredmorgs commented 8 years ago

I'm using franklin as an Embedded Help portal for an app. The app url-matches files in the build root to the same root php pages the app uses. These are the "gateway" into the embedded help for each page.

For example, index.php is url-matched to index.html.

If I use the recommendation of naming files 01-index.adoc this will break the url-matching for index.php

middleman-navtree is sorting folders alphabetically along with filenames, and I'm wondering if a sort option could be put in to control how folders are sorted at the source root?

Perhaps something like options.sort_folders_navtree = [top | bottom] which would allow the folder list to appear at the top of the navtree or the bottom of the navtree?

I was thinking that I could store the "gateway pages" in a /pages directory and then do a post build task to move them, but I'm pretty sure it would break all the file interlinking I have inside the source files.

Any ideas would be greatly appreciated.

bryanbraun commented 8 years ago

@jaredmorgs, for sorting, if the default nav structure isn't sufficient, I'd recommend disabling automatic tree updates. That way, you can customize the structure of the navigation however you want. That should allow you to place folders after the list of links. The only downside is that you'll need to add future nav updates manually.

I haven't worked with the ASCIIDoc integration, so I'm not sure how to get around that naiming requirement for your app. Would it get you closer if you used Middleman's double-extension naming (likeindex.html.adoc)?

bryanbraun commented 7 years ago

I'm going to go ahead an close this. In summary, my current recommendation for this situation is to disable automatic tree updates via the option described in the README, and sort the menu manually.