Comments (7)
Hi!
There was previous discussion on foldable menu (#32)
I didn't find nice solution yet, since I try to keep theme as JS-free as possible, but I have it in mind.
from hugo-book.
Wait for your enhancement~~
from hugo-book.
I added some 'experimental' bookCollapseSection
parameter per page, settings it in section will cause file-tree menu to not render nested section unless visited. Handled at HTML generation time.
Would be nice if you can test it
from hugo-book.
what if I use menu/index.md
to organize my sidebar menu?
from hugo-book.
Hi!
That one would work only for file-tree menu, unfortunately.
Bundle menu will need something more complex 🤔
from hugo-book.
Hi again!
I tried to find nice solution for a while, unfortunately it seems like I didn't find one. So I mark as wontfix.
I think these days filetree menu is much more powerful and we also got hugo native menus now.
I would recommend to switch to filetree menu or make JS script to fold menu and inject it via one of inject
partials.
from hugo-book.
As alex-shpak suggested, I used js in inject partials to un-collapse the menu.
The related code:
Find the id from html:
<li>
<input type="checkbox" id="section-2d21464784c99358edd6d2b29e92ed6f" class="toggle" checked="">
<label for="section-.." class="flex justify-between">
<a href=".." class="active">..</a>
</label>
Add js in themes/hugo-book/layouts/partials/docs/inject/footer.html
<script type="text/javascript">
//Open menu after page loaded.
document.getElementById("section-2d21464784c99358edd6d2b29e92ed6f").click();
</script>
from hugo-book.
Related Issues (20)
- The Search Spinner Keeps Spinning And No Result Appear HOT 4
- How can I make katex enable with $ which displays inline?
- katex, \{ not work, must be \\{ HOT 3
- add feature to toggle menu to allow more width for content HOT 2
- Add support to center docs HOT 2
- fix for BookFavicon not being used
- Deploy for hugo-book-demo fails due to outdated, unsupported build image HOT 1
- How do I shorten my blog when using posts/xx.md? HOT 1
- Site title is prefixed with | HOT 3
- use time.Format in date partial to allow localized formatting HOT 1
- Katex and Mermaid examples in live demo don't work because of /**/ comments HOT 5
- Is there a way to show an image or text on mouseover? HOT 1
- How to add a clearness image in markdown files. HOT 1
- Documentation for Menu
- Installation HOT 1
- README: broken Link HOT 1
- Only show search when JS is enabled HOT 3
- Use null alt text for "minor forms of clipart"? HOT 1
- Set the default value of BookTheme to auto? HOT 2
- Error: "no mixin named theme-light" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-book.