Open pyrog opened 9 years ago
What you are seeing is actually by design... I didn't want the depth argument to print non-clickable directories with nothing inside of them. The philosophy is that directories are for the nesting and grouping of pages, and they aren't worth printing if we aren't going to print the pages inside of them.
I could see how displaying folders might be useful if we supported directory indexes, but I can't think of a reason to display them under the current philosophy.
For the record, changing it would be fairly easy... the relevant code is in /lib/middleman-navtree/helpers.rb
(in the tree_to_html()
function definition). We would just need to move the depth conditional down below the part that prints an li containing dir_name
:
I have the following tree:
With depth=1, the following code display nothing:
But it should display:
With depth=2, the result is good:
Note: This is the tree corresponding to this guide (generate by jekyll): http://learnosm.org/fr/beginner/