forestryio / jekyll-menus

A menus (site navigation) plugin for your Jekyll website that also works with https://forestry.io (Jekyll CMS)
MIT License
134 stars 27 forks source link

Use "parent" as alternative to nesting #12

Open chrisdmacrae opened 6 years ago

chrisdmacrae commented 6 years ago

@envygeeks curious to know if you think the following is possible:

Currently, to handle nested items, you would do something like this:

---
navigation:
   - title: Item 1
      identifier: item_1
      url: /
---
menus:
    item_1:
      title: title: Sub-item 1
---

It would be nice, from an information architecture perspective, to also be able to do:

---
menus:
   - title: Sub-item 1
      parent: item_1
   - title: Sub-item 1
      parent: item_2
    ... etc
envygeeks commented 6 years ago

I don't assume it would be too hard to do but we might need to decouple a few pieces to make it easier to maintain after this is done because this forces a parser split.

I'm not against doing this, I'm not against even making parent an alias of identifier for all other types of menus too (considering the context's it could be used in,) and then eventually in another version further down the line making parent and identifier strict contexts (parent must have an identifier that exists, and identifier is used to create a context.)

I'll see what I can work out if you want.

chrisdmacrae commented 6 years ago

@envygeeks thanks for the honesty!

This would be really great; it seems to be the way most users try to use these menus, and then learn to do it the other way.

Let me know if there's anything I can do to help facilitate this. 👍