bryanbraun / middleman-navtree

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

Multiple "index" filenames not supported? #11

Closed extractachris closed 8 years ago

extractachris commented 8 years ago

I have multiple files named index.html.erb that act as directory indexes for various folders throughout my site.

I noticed NavTree incorrectly associated my site's root index.html.erb with /work/client-1/index.erb.html below and then skips every other folder that uses that same file name:


---
index.html.erb: /work/client-1/index.html.erb
contact: {}
documentation:
  defaults.html.erb: /documentation/defaults.html.erb
  partials:
    _head.erb: /documentation/partials/_head.erb
    _modules_nav.erb: /documentation/partials/_modules_nav.erb
favicon.ico: /favicon.ico
modules:
  contact_card.erb: /modules/contact_card.erb
  copy_block.erb: /modules/copy_block.erb
  featured_media.erb: /modules/featured_media.erb
resume: {}
work:
  client-2:
    project-a: {}
  client-3:
    project-b: {}
  client-4:
    project-c: {}
  client-1:
    project-d: {}
    project-e: {}
bryanbraun commented 8 years ago

@extractachris Thanks for reporting this.

Currently this gem doesn't support directory indexes. It makes the assumption that folders are just for grouping links, and won't actually be links themselves. That leads to the assumption that there won't be multiple index.html files.

You can see https://github.com/bryanbraun/middleman-navtree/issues/8, for a similar issue and how you can use automatic_tree_updates as a workaround for manually updating the tree. It's not an ideal solution.

Here's what I'll do. I'll make it more explicit in the README that directory indexes aren't currently supported, and I'll create a Github issue for tracking progress on that feature.

extractachris commented 8 years ago

Sounds great, thank you! I look forward to keeping an eye on the new ticket.

bryanbraun commented 8 years ago

The new issue is here: https://github.com/bryanbraun/middleman-navtree/issues/12

bryanbraun commented 8 years ago

Also note the update to the README: https://github.com/bryanbraun/middleman-navtree#known-issues