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.
Files changed (57) hide show
  1. package/_config.yml +32 -8
  2. package/layout/_partial/cover/wiki_cover.ejs +1 -1
  3. package/layout/_partial/head.ejs +2 -2
  4. package/layout/_partial/main/article/ai_abstract.ejs +3 -2
  5. package/layout/_partial/main/article/article_footer.ejs +87 -50
  6. package/layout/_partial/main/article/read_next.ejs +17 -12
  7. package/layout/_partial/main/navbar/breadcrumb.ejs +53 -15
  8. package/layout/_partial/main/navbar/list_post.ejs +6 -4
  9. package/layout/_partial/main/navbar/list_wiki.ejs +4 -3
  10. package/layout/_partial/plugins/comments/beaudar/script.ejs +1 -1
  11. package/layout/_partial/plugins/comments/giscus/script.ejs +1 -1
  12. package/layout/_partial/plugins/comments/layout.ejs +2 -2
  13. package/layout/_partial/plugins/comments/utterances/script.ejs +1 -1
  14. package/layout/_partial/sidebar/header.ejs +1 -1
  15. package/layout/_partial/sidebar/index.ejs +3 -3
  16. package/layout/_partial/widgets/ghissues.ejs +1 -1
  17. package/layout/_partial/widgets/ghrepo.ejs +1 -1
  18. package/layout/_partial/widgets/recent.ejs +3 -3
  19. package/layout/_partial/widgets/related.ejs +9 -8
  20. package/layout/_partial/widgets/toc.ejs +15 -10
  21. package/layout/index.ejs +7 -4
  22. package/layout/mermaid.ejs +8 -4
  23. package/layout/page.ejs +3 -0
  24. package/layout/wiki.ejs +3 -0
  25. package/package.json +1 -1
  26. package/scripts/events/lib/doc_tree.js +123 -92
  27. package/scripts/filters/index.js +4 -1
  28. package/scripts/tags/index.js +2 -2
  29. package/scripts/tags/inline-labels.js +2 -2
  30. package/scripts/tags/lib/ablock.js +1 -1
  31. package/scripts/tags/lib/checkbox.js +1 -1
  32. package/scripts/tags/lib/folders.js +1 -1
  33. package/scripts/tags/lib/folding.js +1 -1
  34. package/scripts/tags/lib/hashtag.js +36 -0
  35. package/scripts/tags/lib/image.js +5 -1
  36. package/scripts/tags/lib/mark.js +1 -1
  37. package/scripts/tags/lib/note.js +1 -1
  38. package/scripts/tags/lib/okr.js +140 -0
  39. package/scripts/tags/lib/toc.js +1 -1
  40. package/source/css/_common/highlight.styl +2 -0
  41. package/source/css/_custom.styl +2 -2
  42. package/source/css/_defines/theme.styl +0 -1
  43. package/source/css/_layout/md.styl +10 -7
  44. package/source/css/_layout/partial/bread-nav.styl +32 -0
  45. package/source/css/_layout/partial/paginator.styl +7 -3
  46. package/source/css/_layout/tag-plugins/common.styl +30 -39
  47. package/source/css/_layout/tag-plugins/folding.styl +1 -1
  48. package/source/css/_layout/tag-plugins/hashtag.styl +17 -0
  49. package/source/css/_layout/tag-plugins/mark.styl +2 -5
  50. package/source/css/_layout/tag-plugins/note.styl +1 -1
  51. package/source/css/_layout/tag-plugins/okr.styl +106 -0
  52. package/source/css/_plugins/mermaid.styl +125 -10
  53. package/source/js/main.js +1 -1
  54. package/source/js/plugins/copycode.js +1 -3
  55. package/source/js/plugins/linkcard.js +1 -1
  56. package/scripts/tags/lib/tag.js +0 -35
  57. 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 + 100
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
- } catch (error) {
32
+ } catch (error) {
35
33
  // 未获得用户许可
36
34
  codeCopyBtn.innerText = '未获得用户许可'
37
35
  codeCopyBtn.classList.add('warning')
@@ -42,7 +42,7 @@ function setCardLink(nodes) {
42
42
  }).then(function(data) {
43
43
  renderer(el, data);
44
44
  }).catch(function(error) {
45
- console.log(error);
45
+ console.error(error);
46
46
  });
47
47
  })
48
48
  }
@@ -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
-