Open genebean opened 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
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.
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
The Hugo bits are easy-ish, it’s the html and css that’s a slow go for me
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 .
Thanks! I’ll do that later today
@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
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:
- The PR to the site I am trying to add this to is genebean/indiansprings-hugo#68 https://github.com/genebean/indiansprings-hugo/pull/68
- The preview build of said site on Netlify is https://deploy-preview-68--isd-atl-bsa.netlify.com/
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 .
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
@genebean Any update on this?
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.