vsoch / docsy-jekyll

A Jekyll version of the beautiful Docsy!
https://vsoch.github.io/docsy-jekyll/
Apache License 2.0
199 stars 142 forks source link

Is there a way to make links collapsible in the sidebar? #79

Open SetpointCapybara opened 1 year ago

SetpointCapybara commented 1 year ago

Is there a way to edit the sidebar.html file in order to make the sections of the toc.yml (like "Documentation" or "Extras" in the example site: https://vsoch.github.io/docsy-jekyll/) collapsible just like in the Pandas API Reference (https://pandas.pydata.org/docs/reference/index.html)? In the Pandas documentation, only when you click the name of a section (like Input/output, General functions, etc...) do the pages related to that section appear. Is there a way to easily implement this behavior using the Docsy Jekyll Theme?

vsoch commented 1 year ago

The entire thing is just a website, so you'd need to edit the sidebar.html with your custom (likely) javascript, and css classes to control that. If I were doing it I'd take a look at how that site does it. A very simple way is to add identifiers to the top level and children, and then add an "on click" event for the parent that toggles the visibility of the children.