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
Share sidebar toggle state between pages #541
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Just realized I never responded to this - thanks @da5nsy for reporting. I'm flagging it as an I think the way to do this would be to use browser storage that records the state of the sidebar and persists it across page visits. For example, in the pydata theme: Here we set the position of the sidebar scroll: Here we grab this value and use it to scroll the sidebar to the appropriate location: We could do the same for the |
I would be interested on this feature too ! |
As an alternative to saving and re-setting the collapse state and scroll position, I think it would be nice to have a way to:
This way, when you click on a link to a specific jupyter-book page from an external website, the state of the left navbar would be intuitive. Furthermore, when clicking "next" several times at the bottom of the main content area of jupyter book pages, the left side bar would progressively be updated to track the progress in the overall table of contents. |
Actually, re-reading the code of the However this code does not work in jupyter book because the html components sets |
To also save the toggle state we would need to define a JS function in Unfortunately, the JS generated by Alternatively we could undo the fix I proposed in #754 and instead write a new |
For information, I deployed the fix of #754 to our jupyter book instance. You can see the effect on the scroll state by navigating to a page towards the middle or end of the book, e.g.: https://inria.github.io/scikit-learn-mooc/python_scripts/trees_classification.html As discussed above, this is still messy when you expand a few menu items at the beginning and then click on a section header towards the end of the notebook. Still since is already much better than the current "keep the scroll bar to the top after navigating to a new page". |
Describe the bug
context
https://deploy-preview-2309--the-turing-way.netlify.app (as part of the-turing-way/the-turing-way#2309)
expectation
I had assumed that the sidebar toggle would be inherited when moving from page-to-page within a site, but this does not seem to be happening?
Reproduce the bug
List your environment
https://deploy-preview-2309--the-turing-way.netlify.app (as part of the-turing-way/the-turing-way#2309)
The text was updated successfully, but these errors were encountered: