Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

FEATURE: Nested Navigation Menus #121

Open
genebean opened this issue Mar 4, 2020 · 10 comments
Open

FEATURE: Nested Navigation Menus #121

genebean opened this issue Mar 4, 2020 · 10 comments

Comments

@genebean
Copy link

genebean commented Mar 4, 2020

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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

@pacollins
Copy link
Owner

pacollins commented Mar 14, 2020 via email

@genebean
Copy link
Author

Thanks! I’ll do that later today

@genebean
Copy link
Author

@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
Copy link
Owner

pacollins commented Mar 15, 2020 via email

@genebean
Copy link
Author

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
Copy link
Owner

@genebean Any update on this?

@pacollins pacollins changed the title FEATURE: sub menus FEATURE: Nested Navigation Menus Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants