pacollins / hugo-future-imperfect-slim

Multilingual Blogging Theme for Hugo | Check the Wiki for Documentation
https://themes.gohugo.io/hugo-future-imperfect-slim/
Other
303 stars 194 forks source link

FEATURE: Nested Navigation Menus #121

Open genebean opened 4 years ago

genebean commented 4 years ago

Feature Request

Is your feature request related to a problem?

I would like to be able to easily generate sub menus off of the items that show up in the top nav.

Possible Solution

Extend the template so that nested items in the menu par of the config are added as children of their parent.

Alternatively, and this would actually be preferable, automatically generate sub menus when the menu item has pages under it. In this scenario a max depth would be needed. The ability to filter out some entries would also be nice.

genebean commented 4 years ago

Since submitting this I have learned that Hugo natively supports sub menus via the parent attribute. I’m currently trying to figure out a solution on my own but would welcome help

pacollins commented 4 years ago

This may be obvious, but overthought. Hugo provides a way to template sub menus, but all of the template=ing and CSS would have to be written.

genebean commented 4 years ago

I found a bunch of that yesterday and have started working on it but it’s a slow go for me since I haven’t done that kind of thing in a long time. I’m making a little progress though. I’m aiming for a drop down menu on desktops and an expanding one on mobile

genebean commented 4 years ago

The Hugo bits are easy-ish, it’s the html and css that’s a slow go for me

pacollins commented 4 years ago

Feel free to start a PR. Then I'll be able to assist more seeing your code.

On Sat, Mar 14, 2020, 11:43 AM Gene Liverman notifications@github.com wrote:

The Hugo bits are easy-ish, it’s the html and css that’s a slow go for me

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pacollins/hugo-future-imperfect-slim/issues/121#issuecomment-599082729, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWVJSPU2FNW6ZBUKVL2E4TRHOQZ3ANCNFSM4LA2ZZSA .

genebean commented 4 years ago

Thanks! I’ll do that later today

genebean commented 4 years ago

@pacollins I haven't gotten time to pull this out into a standard PR yet but I do have code you can look at if you are game:

My friend @theinfamousrj helped me get things a tad farther tonight with the visuals. The two remaining UX hurdles are getting the menus to close when you click away from them and getting them to act like an accordion on mobile

pacollins commented 4 years ago

Haven't check your links, but you might have more success building mobile-first. It sounds like you are building desktop and making it into mobile - this isn't really best practice in the modern web. Check how the navbar is designed.

On Sat, Mar 14, 2020 at 10:04 PM Gene Liverman notifications@github.com wrote:

@pacollins https://github.com/pacollins I haven't gotten time to pull this out into a standard PR yet but I do have code you can look at if you are game:

My friend @theinfamousrj https://github.com/theinfamousrj helped me get things a tad farther tonight with the visuals. The two remaining UX hurdles are getting the menus to close when you click away from them and getting them to act like an accordion on mobile

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pacollins/hugo-future-imperfect-slim/issues/121#issuecomment-599157739, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWVJSKNADY5XTEZGLTAQ7LRHQZRPANCNFSM4LA2ZZSA .

genebean commented 4 years ago

Valid point and I know better... I think I got fixated on the desktop view somehow and almost forgot what I harp on all the time. I’ll certainly re-approach it from that perspective

pacollins commented 4 years ago

@genebean Any update on this?