halo-dev / theme-earth

Halo 2.0 的默认主题
https://demo.halo.run/?preview-theme=theme-earth
GNU General Public License v3.0
42 stars 54 forks source link

pref: optimize toc to remove empty directories and fix some bugs #90

Closed LIlGG closed 1 year ago

LIlGG commented 1 year ago

What type of PR is this?

/kind improvement

What this PR does / why we need it:

对 toc 进行优化。 1、当文章不存在 h1、h2、h3、h4 标题时,去除 toc 目录。 2、删除不正确的 activeClass 设置并添加 active-li 的样式

Which issue(s) this PR fixes:

Fixes #87

Does this PR introduce a user-facing change?

优化 Toc 选中样式,当文章不存在目录时,删除空目录。
f2c-ci-robot[bot] commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang, ruibaby

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/halo-dev/theme-earth/blob/main/OWNERS)~~ [JohnNiang,ruibaby] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment