Skip to content
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

Merged
merged 4 commits into from
Dec 25, 2021
Merged

refactor: optimize toc logic #426

merged 4 commits into from
Dec 25, 2021

Conversation

HEIGE-PCloud
Copy link
Owner

  • 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
@HEIGE-PCloud HEIGE-PCloud added the enhancement Enhance existing features label Dec 25, 2021
@HEIGE-PCloud HEIGE-PCloud added this to the v0.2.14 milestone Dec 25, 2021
@HEIGE-PCloud HEIGE-PCloud self-assigned this Dec 25, 2021
@vercel
Copy link

vercel bot commented Dec 25, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pcloud/do-it/5QVGZ8JgjVUKSneghLyk9ShxdSHW
✅ Preview: https://do-it-git-optimize-toc-pcloud.vercel.app

@HEIGE-PCloud
Copy link
Owner Author

HEIGE-PCloud commented Dec 25, 2021

I am considering to drop the support for pageStyle = wide option. An ultra wide page is not a good practice in typography.

@HEIGE-PCloud
Copy link
Owner Author

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
@HEIGE-PCloud
Copy link
Owner Author

Super happy to make theme.js less than 900 lines now :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant