bryanbraun / middleman-navtree

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

Ordering Nav Links Using Frontmatter #10

Closed sanderson closed 8 years ago

sanderson commented 9 years ago

Any chance of implementing an option to order links within directories based on data stored in page frontmatter (i.e. 'priority' or 'order')? Alpha Numeric ordering isn't always ideal.

bryanbraun commented 9 years ago

@sanderson, frontmatter is an interesting thought. The plugin could prioritize frontmatter ordering, if frontmatter data is found, and then fallback to alphanumeric for any pages that don't have frontmatter settings.

Still, we already have a way to declare a custom order and titles, by editing tree.yml directly, and stopping automatic updates to the file with options.automatic_tree_updates = false (see https://github.com/bryanbraun/middleman-navtree/issues/1 for more details). It may be confusing to add frontmatter links, and have multiple reordering paradigms (and edge cases would arise when they conflict with each other).

Is options.automatic_tree_updates sufficient for your needs?

bryanbraun commented 8 years ago

I thought about this some more.

Editing tree.yml directly (via `automatic_tree_updates = false) allows for both custom ordering and nesting. It's more visual and all in one place. For now, I feel like that's superior to any frontmatter-based system I can think of.

Open for thoughts, but otherwise, I'll close this issue.

sanderson commented 8 years ago

Thanks @bryanbraun. I should've responded to your previous reply. That's what I ended up doing and it works well. You can go ahead and close the issue.