-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add accordions to docs menu #2707
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Rafael-gc <[email protected]>
Gave this a try. It does nicely expand things on mouse over. Things never collapse again. Also with the filter things are expanded to show matches. I'm not sure if those things simply weren't planned for or if this is just a first step in the implementation process. |
Now instead of hover above to expand the items It's a click and double click function. One click it expands or collapse, double click redirects to the page. I apologize for the filter problem, It's working now. Thanks for the fast feedback, I'm learning a lot by trying to contribute to this project. |
I haven't tested this yet, but is double click going to be intuitive for users? I don't mean to be a jerk, but there's gotta be some sort of mouse over / mouse away events that you could use along with say a 3-5 sec delay or something? I dunno. Don't put work into changing again until others provide input. |
One problem is that you cant see which nodes are expandable. |
Signed-off-by: Rafael-gc <[email protected]>
You are right. Any clue why it's not showing the subitems of just those four items? |
I'll have a closer look tomorrow. |
I haven't pulled the branch yet and tried it locally. Are there some which are working as expected? |
Yes, I only found these four that aren't working as expected. All others seems right |
I think I’ve discovered the problem. For some reason, all the sub-items (including the ones that don’t have sub-items) of the first item 'Add-ons' are folders that contain their own _index.md files. However, all the other items (Releases, Getting Started, and Desktop UI) are folders that have their own _index.md files and also the files of their sub-items, such as checks.md. I tested it, and replacing the folder 'active-scan-rules' with its respective _index.md file by a file named 'active-scan-rules.md' in the 'addons' folder resolves the problem. However, if preferred, I can adjust my code to identify when a folder contains only one file named _index.md, indicating that it does not have sub-items. |
Thanks for digging into it @Rafael-gc I hadn't managed to get back to it 😔 I think the second option is best but let's allow others to add their two cents. |
The first is not really an option, the files are automatically generated and they have that name/structure because that's how Hugo works https://gohugo.io/content-management/organization/ so updating the code to correctly identify the structure is the proper fix. |
I have implemented some mouse over / mouse away events along with 5 secs delay, as suggested by @kingthorin . Please give it a try and send me some feedback when possible. Thanks for the help |
Hey @Rafael-gc please know this isn't forgotten. A number of other things (ex: a broken wrist) have required my attention lately. I'll try to get back around to testing it sometime later this week. |
I finally got to test this. It seems okay to me. I think if the user has clicked into some part of the menu it should probably stick expanded at that location (as they're likely to want to access related/adjacent pages). But maybe I'm getting picky 🤷♂️ |
I've tried this out and I'm afraid I find it frustrating to use :/ |
My proposal for improving the navigation tree. Now the tree only expands when the user hovers the cursor over the item.
This is my first time contribuiting to this project so please let me know if I'm doing things right!