ppoffice / hexo-component-inferno

A collection of Inferno.js layout components and utility scripts for Hexo
https://ppoffice.github.io/hexo-component-inferno/
24 stars 30 forks source link

Feature Request: auto_expand for toc #10

Closed Ray-Eldath closed 4 years ago

Ray-Eldath commented 4 years ago

currently the toc generated for post will show all subtitles at once. for many long articles, this will leads to a full-page catalogue with many lines wrapped: image it wastes space while affecting user experience, for some substitles may be hidden forever provided the toc is still sticked. one decent solution is to make the toc stacked by default, but expended when the subtitle enters viewport:

image

two popular hexo themes already bundled with such function AFAIK, related code is at here and here. I'm still investigating how to integrate such feature into icarus, hope the solution will be found out soon.

ppoffice commented 4 years ago

Feature added in https://github.com/ppoffice/hexo-component-inferno/releases/tag/0.6.0 Demo: https://ppoffice.github.io/hexo-theme-icarus/Configuration/icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE/