RFC: Menu: only expand active hierarchy#195
Conversation
Before this change, the entire menu tree below the selected top-level heading was expanded. This change adds some triangles on menu items at level 2 and below to indicate which ones can be or are expanded. I didn't put them on the top level, because I felt that it looked too cluttered and didn't add much value. Fixes matcornic#88
|
Agree, this is an excellent addition. However I believe it should be enabled only with a toggle and set to off by default to avoid breaking people's existing websites who don't expect this behaviour. @robhoes would you be able to wrap this in a config toggle? |
|
Thanks guys. Yes, I'll have a look at adding a toggle. I need to see how to do it for the CSS bit though, which would probably need a slightly bigger change. |
|
I had another read of this yesterday and spotted you already have a toggle named |
|
Oh interesting. Then we just need to make that the default somehow, and also make it hide the new markers. |
|
My view on this, and I'm happy to help implement if you like...
|
|
FWIW, agree 100% with some sort of way to manage menu expansion - especially for large docsets. Not a fan of the auto-chevrons either, but one option you could consider that worked for my project are a pair of site parameters that operate like the |
|
Sorry, I got stuck with other work. I'll see if I can update the PR soon to take into account the feedback above. |
|
Hi there! Any news? |
|
Please see issue #355 for a pull request against master to solve this issue. |
|
Sorry for my lack of engagement on this, and thanks @oldenboom for picking this up. I'll close this PR now in favour of yours. |
|
Hi, I would like to implement this but not sure how to do it. Any help would be appreciated. Thanks. |
|
@jmrichardson see the changes here https://github.com/matcornic/hugo-theme-learn/pull/195/files Red lines represent deletions. Green ones represent additions. |
|
@jmrichardson the changes suggested by @Nightshadelink won't match with the latest branch of this theme. This one will: |
|
Thanks, yes, I just cloned your repo from here https://github.com/oldenboom/hugo-theme-learn and it works. Thanks. |
Before this change, the entire menu tree below the selected top-level heading
was expanded.
This change adds some triangles on menu items at level 2 and below to indicate
which ones can be or are expanded. I didn't put them on the top level, because
I felt that it looked too cluttered and didn't add much value.
Fixes #88
Here is an example of what this looks like: https://robhoes.github.io/hugo-theme-learn/en/shortcodes/children.
Would it be desirable to add a configuration option for this, perhaps just for the new marks in the menu?