-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
refactor: optimize toc logic #426
Conversation
HEIGE-PCloud
commented
Dec 25, 2021
- use CSS to set its width instead of JavaScript code
- process the logic of static toc and auto toc in Hugo template instead of JavaScript code
- use CSS to set its width instead of js - process the logic of static toc and auto toc in hugo template instead of js
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pcloud/do-it/5QVGZ8JgjVUKSneghLyk9ShxdSHW |
I am considering to drop the support for |
The toc will not "show up later" (after the JS code is executed) now. |
- Since the position calcuation is done by CSS (and media query) now, there is no need to initToc onResize
Super happy to make theme.js less than 900 lines now :D |