hexo-auto-toc 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/index.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ cd hexo-auto-toc
|
|
|
14
14
|
npm install
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Requirement cheerio
|
|
17
|
+
Requirement cheerio:`npm install` above replaces `npm install cheerio --save`
|
|
18
18
|
|
|
19
19
|
2. The plugin will automatically parse all content within the `<article>` tag and generate a table of contents.
|
|
20
20
|
If your article page structure does not wrap the content inside an `<article>` element, contents in`<body>` will be parsed. Or you can add `<article>` manually — typically in the `index.html` file under your `blog` folder, but this is not necessary.
|
|
@@ -69,6 +69,8 @@ npm install
|
|
|
69
69
|
|
|
70
70
|
Automatic Layout: Enhanced the left/right placement of the TOC, allowing it to automatically choose the best side.
|
|
71
71
|
|
|
72
|
+
7.9 长度优化
|
|
73
|
+
|
|
72
74
|
# Recommendations
|
|
73
75
|
|
|
74
76
|
- hexo-everyday-calendar:This is a practical calendar plugin for hexo bloggers, like contribution statistics on GitHub.
|
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ hexo.extend.filter.register('after_render:html', function (html) {
|
|
|
36
36
|
top: 0vh;
|
|
37
37
|
left: 0px;
|
|
38
38
|
width: 15rem;
|
|
39
|
-
max-height:
|
|
39
|
+
max-height: 80vh;
|
|
40
40
|
overflow-y: auto;
|
|
41
41
|
overflow-x: auto;
|
|
42
42
|
padding: 10px;
|
|
@@ -72,6 +72,7 @@ hexo.extend.filter.register('after_render:html', function (html) {
|
|
|
72
72
|
const toc = document.querySelector('#fixed-toc-container');
|
|
73
73
|
if (toc) {
|
|
74
74
|
toc.style.top = navBottom + 'px';
|
|
75
|
+
toc.style.maxHeight=window.innerHeight - navBottom.getBoundingClientRect().bottom;
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hexo-auto-toc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Automatically generates a responsive table of contents that fixes to the side of the article page or above the articles, depending on the user's device.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"toc",
|