hexo-theme-stellar 1.19.0 → 1.20.0
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/_config.yml +32 -8
- package/layout/_partial/cover/wiki_cover.ejs +1 -1
- package/layout/_partial/head.ejs +2 -2
- package/layout/_partial/main/article/ai_abstract.ejs +3 -2
- package/layout/_partial/main/article/article_footer.ejs +87 -50
- package/layout/_partial/main/article/read_next.ejs +17 -12
- package/layout/_partial/main/navbar/breadcrumb.ejs +53 -15
- package/layout/_partial/main/navbar/list_post.ejs +6 -4
- package/layout/_partial/main/navbar/list_wiki.ejs +4 -3
- package/layout/_partial/plugins/comments/beaudar/script.ejs +1 -1
- package/layout/_partial/plugins/comments/giscus/script.ejs +1 -1
- package/layout/_partial/plugins/comments/layout.ejs +2 -2
- package/layout/_partial/plugins/comments/utterances/script.ejs +1 -1
- package/layout/_partial/sidebar/header.ejs +1 -1
- package/layout/_partial/sidebar/index.ejs +3 -3
- package/layout/_partial/widgets/ghissues.ejs +1 -1
- package/layout/_partial/widgets/ghrepo.ejs +1 -1
- package/layout/_partial/widgets/recent.ejs +3 -3
- package/layout/_partial/widgets/related.ejs +9 -8
- package/layout/_partial/widgets/toc.ejs +15 -10
- package/layout/index.ejs +7 -4
- package/layout/mermaid.ejs +8 -4
- package/layout/page.ejs +3 -0
- package/layout/wiki.ejs +3 -0
- package/package.json +1 -1
- package/scripts/events/lib/doc_tree.js +123 -92
- package/scripts/filters/index.js +4 -1
- package/scripts/tags/index.js +2 -2
- package/scripts/tags/inline-labels.js +2 -2
- package/scripts/tags/lib/ablock.js +1 -1
- package/scripts/tags/lib/checkbox.js +1 -1
- package/scripts/tags/lib/folders.js +1 -1
- package/scripts/tags/lib/folding.js +1 -1
- package/scripts/tags/lib/hashtag.js +36 -0
- package/scripts/tags/lib/image.js +5 -1
- package/scripts/tags/lib/mark.js +1 -1
- package/scripts/tags/lib/note.js +1 -1
- package/scripts/tags/lib/okr.js +140 -0
- package/scripts/tags/lib/toc.js +1 -1
- package/source/css/_common/highlight.styl +2 -0
- package/source/css/_custom.styl +2 -2
- package/source/css/_defines/theme.styl +0 -1
- package/source/css/_layout/md.styl +10 -7
- package/source/css/_layout/partial/bread-nav.styl +32 -0
- package/source/css/_layout/partial/paginator.styl +7 -3
- package/source/css/_layout/tag-plugins/common.styl +30 -39
- package/source/css/_layout/tag-plugins/folding.styl +1 -1
- package/source/css/_layout/tag-plugins/hashtag.styl +17 -0
- package/source/css/_layout/tag-plugins/mark.styl +2 -5
- package/source/css/_layout/tag-plugins/note.styl +1 -1
- package/source/css/_layout/tag-plugins/okr.styl +106 -0
- package/source/css/_plugins/mermaid.styl +125 -10
- package/source/js/main.js +1 -1
- package/source/js/plugins/copycode.js +1 -3
- package/source/js/plugins/linkcard.js +1 -1
- package/scripts/tags/lib/tag.js +0 -35
- package/source/css/_layout/tag-plugins/tag.styl +0 -13
|
@@ -1,10 +1,125 @@
|
|
|
1
|
-
pre.mermaid
|
|
2
|
-
display: inline-block
|
|
3
|
-
width: 100
|
|
4
|
-
text-align: center
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.mermaid svg
|
|
8
|
-
width: 100
|
|
9
|
-
display: inline-block
|
|
10
|
-
|
|
1
|
+
pre.mermaid
|
|
2
|
+
display: inline-block
|
|
3
|
+
width: 100%
|
|
4
|
+
text-align: center
|
|
5
|
+
font-family: $ff-body
|
|
6
|
+
|
|
7
|
+
.mermaid svg
|
|
8
|
+
width: 100%
|
|
9
|
+
display: inline-block
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
.mermaid svg
|
|
13
|
+
width: 100%
|
|
14
|
+
display: inline-block
|
|
15
|
+
|
|
16
|
+
.mermaid span,text
|
|
17
|
+
font-family: $ff-body
|
|
18
|
+
|
|
19
|
+
.mermaid .edgeLabel
|
|
20
|
+
padding: 4px
|
|
21
|
+
background-color: var(--site-bg) !important
|
|
22
|
+
|
|
23
|
+
.mermaid rect.basic.label-container
|
|
24
|
+
stroke: var(--block-border) !important
|
|
25
|
+
fill: var(--block) !important
|
|
26
|
+
|
|
27
|
+
set_mermaid_darkmode()
|
|
28
|
+
.mermaid
|
|
29
|
+
fill: #ccc !important
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
.mermaid .error-icon
|
|
33
|
+
fill: #a44141 !important
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
.mermaid .error-text
|
|
37
|
+
fill: #ddd !important
|
|
38
|
+
stroke: #ddd !important
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
.mermaid .marker
|
|
42
|
+
fill: lightgrey !important
|
|
43
|
+
stroke: lightgrey !important
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
.mermaid .marker.cross
|
|
47
|
+
stroke: lightgrey !important
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
.mermaid .label
|
|
51
|
+
color: #ccc !important
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
.mermaid .cluster-label text
|
|
55
|
+
fill: #F9FFFE !important
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
.mermaid .cluster-label span
|
|
59
|
+
color: #F9FFFE !important
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
.mermaid .label text,
|
|
63
|
+
.mermaid span
|
|
64
|
+
fill: #ccc !important
|
|
65
|
+
color: #ccc !important
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
.mermaid .node rect,
|
|
69
|
+
.mermaid .node circle,
|
|
70
|
+
.mermaid .node ellipse,
|
|
71
|
+
.mermaid .node polygon,
|
|
72
|
+
.mermaid .node path
|
|
73
|
+
fill: #1f2020 !important
|
|
74
|
+
stroke: #81B1DB !important
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
.mermaid .arrowheadPath
|
|
78
|
+
fill: lightgrey !important
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
.mermaid .edgePath .path
|
|
82
|
+
stroke: lightgrey !important
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
.mermaid .flowchart-link
|
|
86
|
+
stroke: lightgrey !important
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
.mermaid .edgeLabel
|
|
90
|
+
background-color: hsl(0, 0%, 34.4117647059%) !important
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
.mermaid .edgeLabel rect
|
|
94
|
+
background-color: hsl(0, 0%, 34.4117647059%) !important
|
|
95
|
+
fill: hsl(0, 0%, 34.4117647059%) !important
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
.mermaid .cluster rect
|
|
99
|
+
fill: hsl(180, 1.5873015873%, 28.3529411765%) !important
|
|
100
|
+
stroke: rgba(255, 255, 255, 0.25) !important
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
.mermaid .cluster text
|
|
104
|
+
fill: #F9FFFE !important
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
.mermaid .cluster span
|
|
108
|
+
color: #F9FFFE !important
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
.mermaid div.mermaidTooltip
|
|
112
|
+
background: hsl(20, 1.5873015873%, 12.3529411765%) !important
|
|
113
|
+
border: 1px solid rgba(255, 255, 255, 0.25) !important
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
.mermaid .flowchartTitleText
|
|
117
|
+
fill: #ccc
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
if hexo-config('style.darkmode') == 'auto'
|
|
121
|
+
@media (prefers-color-scheme: dark)
|
|
122
|
+
set_mermaid_darkmode()
|
|
123
|
+
|
|
124
|
+
if hexo-config('style.darkmode') == 'always'
|
|
125
|
+
set_mermaid_darkmode()
|
package/source/js/main.js
CHANGED
|
@@ -126,7 +126,7 @@ const init = {
|
|
|
126
126
|
highlightItem.addClass("active")
|
|
127
127
|
const e0 = document.querySelector('.widgets')
|
|
128
128
|
const e1 = document.querySelector('#data-toc a.toc-link[href="' + encodeURI(link) + '"]')
|
|
129
|
-
const offsetBottom = e1.getBoundingClientRect().bottom - e0.getBoundingClientRect().bottom +
|
|
129
|
+
const offsetBottom = e1.getBoundingClientRect().bottom - e0.getBoundingClientRect().bottom + 200
|
|
130
130
|
const offsetTop = e1.getBoundingClientRect().top - e0.getBoundingClientRect().top - 64
|
|
131
131
|
if (offsetTop < 0) {
|
|
132
132
|
e0.scrollBy(0, offsetTop)
|
|
@@ -26,12 +26,10 @@ codeElementArr.forEach(code => {
|
|
|
26
26
|
})
|
|
27
27
|
|
|
28
28
|
async function copyCode(currentCode) {
|
|
29
|
-
// console.log(currentCode)
|
|
30
|
-
// console.log('复制代码')
|
|
31
29
|
if (navigator.clipboard) {
|
|
32
30
|
try {
|
|
33
31
|
await navigator.clipboard.writeText(currentCode)
|
|
34
|
-
|
|
32
|
+
} catch (error) {
|
|
35
33
|
// 未获得用户许可
|
|
36
34
|
codeCopyBtn.innerText = '未获得用户许可'
|
|
37
35
|
codeCopyBtn.classList.add('warning')
|
package/scripts/tags/lib/tag.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tag.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
-
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
-
*
|
|
5
|
-
* {% tag text href [color:color] %}
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
'use strict'
|
|
10
|
-
|
|
11
|
-
const tag_colors = ['red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple']
|
|
12
|
-
var tag_index = 0
|
|
13
|
-
|
|
14
|
-
module.exports = ctx => function(args) {
|
|
15
|
-
args = ctx.args.map(args, ['color'], ['text', 'href'])
|
|
16
|
-
if (args.color == null) {
|
|
17
|
-
const default_color = ctx.theme.config.tag_plugins.tag?.default_color
|
|
18
|
-
if (default_color) {
|
|
19
|
-
args.color = default_color
|
|
20
|
-
} else {
|
|
21
|
-
args.color = tag_colors[tag_index]
|
|
22
|
-
tag_index += 1
|
|
23
|
-
if (tag_index >= tag_colors.length) {
|
|
24
|
-
tag_index = 0
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
var el = ''
|
|
29
|
-
el += '<a class="tag-plugin tag"'
|
|
30
|
-
el += ' ' + ctx.args.joinTags(args, ['color', 'href']).join(' ')
|
|
31
|
-
el += '>'
|
|
32
|
-
el += args.text
|
|
33
|
-
el += '</a>'
|
|
34
|
-
return el
|
|
35
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
.md-text .tag-plugin.tag
|
|
2
|
-
padding: 0px 4px
|
|
3
|
-
border-radius: 2px
|
|
4
|
-
background: var(--theme-bg1)
|
|
5
|
-
color: var(--text-p2)
|
|
6
|
-
margin: 2px 0
|
|
7
|
-
display: inline-block
|
|
8
|
-
font-size: $fs-14
|
|
9
|
-
trans2 background color
|
|
10
|
-
&:hover
|
|
11
|
-
background: var(--text-p2)
|
|
12
|
-
color: var(--theme-bg1)
|
|
13
|
-
|