hexo-theme-stellar 1.28.0 → 1.29.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 (126) hide show
  1. package/_config.yml +55 -6
  2. package/_data/icons.yml +3 -1
  3. package/_data/widgets.yml +6 -0
  4. package/languages/en.yml +7 -0
  5. package/languages/zh-CN.yml +7 -0
  6. package/languages/zh-TW.yml +7 -0
  7. package/layout/_partial/comments/artalk/script.ejs +9 -13
  8. package/layout/_partial/comments/beaudar/script.ejs +20 -23
  9. package/layout/_partial/comments/giscus/script.ejs +11 -11
  10. package/layout/_partial/comments/twikoo/script.ejs +12 -17
  11. package/layout/_partial/comments/utterances/script.ejs +20 -23
  12. package/layout/_partial/comments/waline/script.ejs +9 -16
  13. package/layout/_partial/head.ejs +1 -1
  14. package/layout/_partial/main/article/article_footer.ejs +6 -2
  15. package/layout/_partial/main/article/related_posts.ejs +1 -1
  16. package/layout/_partial/main/navbar/article_banner.ejs +2 -0
  17. package/layout/_partial/main/navbar/breadcrumb/note.ejs +8 -0
  18. package/layout/_partial/main/navbar/dateinfo.ejs +11 -0
  19. package/layout/_partial/main/notebook/note_card.ejs +36 -0
  20. package/layout/_partial/main/notebook/note_tags.ejs +9 -0
  21. package/layout/_partial/main/notebook/notebook_card.ejs +10 -0
  22. package/layout/_partial/main/notebook/paginator.ejs +9 -0
  23. package/layout/_partial/scripts/tagtree.ejs +29 -0
  24. package/layout/_partial/scripts/theme.ejs +62 -0
  25. package/layout/_partial/scripts.ejs +4 -1
  26. package/layout/_partial/sidebar/index_leftbar.ejs +10 -0
  27. package/layout/_partial/sidebar/index_rightbar.ejs +10 -0
  28. package/layout/_partial/sidebar/search.ejs +4 -0
  29. package/layout/_partial/widgets/recent.ejs +10 -0
  30. package/layout/_partial/widgets/tagtree.ejs +59 -0
  31. package/layout/_partial/widgets/toc.ejs +7 -5
  32. package/layout/_plugins/fancybox.ejs +2 -2
  33. package/layout/_plugins/tianli_gpt.ejs +1 -1
  34. package/layout/layout.ejs +5 -1
  35. package/layout/notebooks.ejs +8 -0
  36. package/layout/notes.ejs +12 -0
  37. package/layout/page.ejs +11 -1
  38. package/package.json +1 -1
  39. package/scripts/events/index.js +1 -0
  40. package/scripts/events/lib/notebooks.js +153 -0
  41. package/scripts/generators/notebooks.js +71 -0
  42. package/scripts/tags/index.js +5 -0
  43. package/scripts/tags/lib/image.js +16 -4
  44. package/scripts/tags/lib/quot.js +1 -2
  45. package/scripts/tags/lib/read/paper.js +90 -0
  46. package/scripts/tags/lib/read/reel.js +43 -0
  47. package/scripts/tags/lib/video.js +11 -6
  48. package/source/css/_common/button.styl +3 -3
  49. package/source/css/_common/device.styl +3 -3
  50. package/source/css/_common/highlight.styl +4 -2
  51. package/source/css/{_layout → _components}/md.styl +21 -19
  52. package/source/css/_components/pages/notebook.styl +65 -0
  53. package/source/css/{_layout → _components}/partial/article-banner.styl +4 -4
  54. package/source/css/{_layout → _components}/tag-plugins/common.styl +2 -2
  55. package/source/css/_components/tag-plugins/index.styl +1 -0
  56. package/source/css/{_layout → _components}/tag-plugins/media.styl +1 -1
  57. package/source/css/{_layout → _components}/tag-plugins/quot.styl +0 -2
  58. package/source/css/_components/tag-plugins/read/paper.styl +98 -0
  59. package/source/css/_components/tag-plugins/read/reel.styl +103 -0
  60. package/source/css/_defines/func.styl +4 -6
  61. package/source/css/_defines/theme.styl +36 -38
  62. package/source/css/_plugins/comments/waline.styl +3 -3
  63. package/source/css/_plugins/fancybox.styl +1 -1
  64. package/source/css/_plugins/mermaid.styl +2 -2
  65. package/source/css/main.styl +1 -1
  66. package/source/js/main.js +14 -0
  67. package/source/js/plugins/copycode.js +1 -1
  68. package/source/js/search/local-search.js +2 -2
  69. /package/source/css/{_layout → _components}/index.styl +0 -0
  70. /package/source/css/{_layout → _components}/layout.styl +0 -0
  71. /package/source/css/{_layout → _components}/list.styl +0 -0
  72. /package/source/css/{_layout → _components}/main.styl +0 -0
  73. /package/source/css/{_layout → _components}/pages/archives.styl +0 -0
  74. /package/source/css/{_layout → _components}/pages/error.styl +0 -0
  75. /package/source/css/{_layout → _components}/partial/article-footer.styl +0 -0
  76. /package/source/css/{_layout → _components}/partial/bread-nav.styl +0 -0
  77. /package/source/css/{_layout → _components}/partial/cover.styl +0 -0
  78. /package/source/css/{_layout → _components}/partial/footer.styl +0 -0
  79. /package/source/css/{_layout → _components}/partial/navbar.styl +0 -0
  80. /package/source/css/{_layout → _components}/partial/paginator.styl +0 -0
  81. /package/source/css/{_layout → _components}/partial/related.styl +0 -0
  82. /package/source/css/{_layout → _components}/sidebar/footer.styl +0 -0
  83. /package/source/css/{_layout → _components}/sidebar/logo.styl +0 -0
  84. /package/source/css/{_layout → _components}/sidebar/menu.styl +0 -0
  85. /package/source/css/{_layout → _components}/sidebar/nav-area.styl +0 -0
  86. /package/source/css/{_layout → _components}/sidebar/search.styl +0 -0
  87. /package/source/css/{_layout → _components}/sidebar/sidebar.styl +0 -0
  88. /package/source/css/{_layout → _components}/tag-plugins/about.styl +0 -0
  89. /package/source/css/{_layout → _components}/tag-plugins/banner.styl +0 -0
  90. /package/source/css/{_layout → _components}/tag-plugins/button.styl +0 -0
  91. /package/source/css/{_layout → _components}/tag-plugins/checkbox.styl +0 -0
  92. /package/source/css/{_layout → _components}/tag-plugins/copy.styl +0 -0
  93. /package/source/css/{_layout → _components}/tag-plugins/emoji.styl +0 -0
  94. /package/source/css/{_layout → _components}/tag-plugins/folders.styl +0 -0
  95. /package/source/css/{_layout → _components}/tag-plugins/folding.styl +0 -0
  96. /package/source/css/{_layout → _components}/tag-plugins/frame.styl +0 -0
  97. /package/source/css/{_layout → _components}/tag-plugins/friends.styl +0 -0
  98. /package/source/css/{_layout → _components}/tag-plugins/gallery.styl +0 -0
  99. /package/source/css/{_layout → _components}/tag-plugins/ghcard.styl +0 -0
  100. /package/source/css/{_layout → _components}/tag-plugins/grid.styl +0 -0
  101. /package/source/css/{_layout → _components}/tag-plugins/hashtag.styl +0 -0
  102. /package/source/css/{_layout → _components}/tag-plugins/icon.styl +0 -0
  103. /package/source/css/{_layout → _components}/tag-plugins/image.styl +0 -0
  104. /package/source/css/{_layout → _components}/tag-plugins/inline-labels.styl +0 -0
  105. /package/source/css/{_layout → _components}/tag-plugins/link.styl +0 -0
  106. /package/source/css/{_layout → _components}/tag-plugins/mark.styl +0 -0
  107. /package/source/css/{_layout → _components}/tag-plugins/navbar.styl +0 -0
  108. /package/source/css/{_layout → _components}/tag-plugins/note.styl +0 -0
  109. /package/source/css/{_layout → _components}/tag-plugins/okr.styl +0 -0
  110. /package/source/css/{_layout → _components}/tag-plugins/override.styl +0 -0
  111. /package/source/css/{_layout → _components}/tag-plugins/poetry.styl +0 -0
  112. /package/source/css/{_layout → _components}/tag-plugins/sites.styl +0 -0
  113. /package/source/css/{_layout → _components}/tag-plugins/tabs.styl +0 -0
  114. /package/source/css/{_layout → _components}/tag-plugins/timeline.styl +0 -0
  115. /package/source/css/{_layout → _components}/tag-plugins/toc.styl +0 -0
  116. /package/source/css/{_layout → _components}/widgets/components.styl +0 -0
  117. /package/source/css/{_layout → _components}/widgets/ghrepo.styl +0 -0
  118. /package/source/css/{_layout → _components}/widgets/ghuser.styl +0 -0
  119. /package/source/css/{_layout → _components}/widgets/list.styl +0 -0
  120. /package/source/css/{_layout → _components}/widgets/markdown.styl +0 -0
  121. /package/source/css/{_layout → _components}/widgets/related.styl +0 -0
  122. /package/source/css/{_layout → _components}/widgets/tagcloud.styl +0 -0
  123. /package/source/css/{_layout → _components}/widgets/timeline.styl +0 -0
  124. /package/source/css/{_layout → _components}/widgets/toc.styl +0 -0
  125. /package/source/css/{_layout → _components}/widgets/tree.styl +0 -0
  126. /package/source/css/{_layout → _components}/widgets/widgets.styl +0 -0
@@ -0,0 +1,103 @@
1
+ .md-text .tag-plugin.reel
2
+ display: flex
3
+ flex-direction: column
4
+ align-items: center
5
+ padding-top: var(--gap-padding)
6
+ padding-bottom: var(--gap-padding)
7
+ >.content
8
+ display: flex
9
+ flex-direction: column
10
+ writing-mode: vertical-rl
11
+ border-top: 1px dashed var(--text-meta)
12
+ border-bottom: 1px dashed var(--text-meta)
13
+ max-width: calc(100% - 80px)
14
+ padding: 1rem
15
+ >.title
16
+ font-weight: 500
17
+ font-size: 1rem
18
+ >.meta
19
+ color: var(--text-p2)
20
+ font-size: $fs-12
21
+ font-weight: 500
22
+ >.body
23
+ overflow: auto
24
+ scrollbar()
25
+ margin: 'calc(%s - 4px) %s' % var(--gap-padding)
26
+ .main
27
+ p
28
+ margin: 0;
29
+ font-size: $fs-14
30
+ >.date
31
+ color: var(--text-p2)
32
+ font-size: $fs-12
33
+ font-weight: 500
34
+ text-align: right
35
+ // margin-left: var(--gap-p)
36
+ >.footer
37
+ color: var(--text-p4)
38
+ font-size: $fs-12
39
+ text-align: right
40
+
41
+ // 描边修饰
42
+ .md-text .tag-plugin.reel>.content
43
+ position: relative
44
+ &:before
45
+ content: ''
46
+ position: absolute
47
+ width: 4px
48
+ left: -4px
49
+ top: -16px
50
+ bottom: -16px
51
+ border-radius: 4px
52
+ background: var(--block)
53
+ &:after
54
+ content: ''
55
+ position: absolute
56
+ width: 4px
57
+ left: calc(100%)
58
+ top: -16px
59
+ bottom: -16px
60
+ border-radius: 4px
61
+ background: var(--block)
62
+ >.title
63
+ position: relative
64
+ &:before
65
+ content: ''
66
+ position: absolute
67
+ width: 4px
68
+ right: calc(-1rem - 4px)
69
+ top: calc(-1rem - 6px)
70
+ bottom: calc(100% + 1rem - 6px)
71
+ border-radius: 4px
72
+ background: $color-accent
73
+ z-index: 1
74
+ &:after
75
+ content: ''
76
+ position: absolute
77
+ width: 4px
78
+ right: calc(-1rem - 4px)
79
+ top: calc(100% + 1rem - 6px)
80
+ bottom: calc(-1rem - 6px)
81
+ border-radius: 4px
82
+ background: $color-accent
83
+ z-index: 1
84
+ >.footer
85
+ position: relative
86
+ &:before
87
+ content: ''
88
+ position: absolute
89
+ width: 4px
90
+ left: calc(-1rem - 4px)
91
+ top: calc(-1rem - 6px)
92
+ bottom: calc(100% + 1rem - 6px)
93
+ border-radius: 4px
94
+ background: $color-accent
95
+ &:after
96
+ content: ''
97
+ position: absolute
98
+ width: 4px
99
+ left: calc(-1rem - 4px)
100
+ top: calc(100% + 1rem - 6px)
101
+ bottom: calc(-1rem - 6px)
102
+ border-radius: 4px
103
+ background: $color-accent
@@ -113,13 +113,11 @@ hoverable-card()
113
113
  ondark()
114
114
  &:hover
115
115
  box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
116
- if theme(light)
116
+ :root[data-theme="light"] &
117
117
  onlight()
118
- else if theme(dark)
118
+ :root[data-theme="dark"] &
119
119
  ondark()
120
- else
121
- @media (prefers-color-scheme: light)
122
- onlight()
120
+ :root:not([data-theme]) &
121
+ onlight()
123
122
  @media (prefers-color-scheme: dark)
124
123
  ondark()
125
-
@@ -1,3 +1,4 @@
1
+ // Deprecated function. Keep for compatibility.
1
2
  theme($t)
2
3
  convert(hexo-config('style.prefers_theme')) == $t
3
4
 
@@ -40,47 +41,44 @@ _common_root()
40
41
  --theme-link: $color-link
41
42
 
42
43
  _light_root()
43
- :root
44
- --site-bg: hsl($color-background-h, $color-background-s, $color-background-l)
45
- --card: hsl($color-block-h, $color-block-s, 100)
46
- --block: hsl($color-block-h, $color-block-s, 95)
47
- --block-border: hsl($color-block-h, $color-block-s, 90)
48
- --block-hover: hsl($color-block-h, $color-block-s, 92)
49
- --theme-link-opa: rgba($color-link, 0.2)
50
- --leftbar-bg: hsl($color-block-h, $color-block-s, 90)
51
- --alpha20: rgba(white, 0.2)
52
- --alpha50: rgba(white, 0.5)
53
- --alpha60: rgba(white, 0.6)
54
- --alpha75: rgba(white, 0.75)
55
- --alpha100: white
56
- _dark_text()
57
-
44
+ --site-bg: hsl($color-background-h, $color-background-s, $color-background-l)
45
+ --card: hsl($color-block-h, $color-block-s, 100)
46
+ --block: hsl($color-block-h, $color-block-s, 95)
47
+ --block-border: hsl($color-block-h, $color-block-s, 90)
48
+ --block-hover: hsl($color-block-h, $color-block-s, 92)
49
+ --theme-link-opa: rgba($color-link, 0.2)
50
+ --leftbar-bg: hsl($color-block-h, $color-block-s, 90)
51
+ --alpha20: rgba(white, 0.2)
52
+ --alpha50: rgba(white, 0.5)
53
+ --alpha60: rgba(white, 0.6)
54
+ --alpha75: rgba(white, 0.75)
55
+ --alpha100: white
56
+ _dark_text()
57
+
58
58
  _dark_root()
59
- :root
60
- --site-bg: hsl($color-background-h, $color-background-s * 0.5, (100 - $color-background-l) * 2 + 8)
61
- --card: hsl($color-block-h, $color-block-s * 1.2, 24)
62
- --block: hsl($color-block-h, $color-block-s, 16)
63
- --block-border: hsl($color-block-h, $color-block-s, 24)
64
- --block-hover: hsl($color-block-h, $color-block-s, 20)
65
- --theme-link-opa: rgba($color-link, 0.4)
66
- --leftbar-bg: hsl($color-block-h, $color-block-s, 24)
67
- --alpha20: rgba(black, 0.2)
68
- --alpha50: rgba(black, 0.5)
69
- --alpha60: rgba(black, 0.6)
70
- --alpha75: rgba(black, 0.75)
71
- --alpha100: black
72
- _light_text()
73
- @media screen and (max-width: $device-mobile-max)
74
- --site-bg: black
59
+ --site-bg: hsl($color-background-h, $color-background-s * 0.5, (100 - $color-background-l) * 2 + 8)
60
+ --card: hsl($color-block-h, $color-block-s * 1.2, 24)
61
+ --block: hsl($color-block-h, $color-block-s, 16)
62
+ --block-border: hsl($color-block-h, $color-block-s, 24)
63
+ --block-hover: hsl($color-block-h, $color-block-s, 20)
64
+ --theme-link-opa: rgba($color-link, 0.4)
65
+ --leftbar-bg: hsl($color-block-h, $color-block-s, 24)
66
+ --alpha20: rgba(black, 0.2)
67
+ --alpha50: rgba(black, 0.5)
68
+ --alpha60: rgba(black, 0.6)
69
+ --alpha75: rgba(black, 0.75)
70
+ --alpha100: black
71
+ _light_text()
72
+ @media screen and (max-width: $device-mobile-max)
73
+ --site-bg: black
75
74
 
76
75
  _common_root()
77
- // 默认自动模式
78
- if theme(light)
76
+
77
+ :root[data-theme="light"]
79
78
  _light_root()
80
- else if theme(dark)
79
+ :root[data-theme="dark"]
81
80
  _dark_root()
82
- else
83
- @media (prefers-color-scheme: light)
84
- _light_root()
81
+ :root:not([data-theme])
82
+ _light_root()
85
83
  @media (prefers-color-scheme: dark)
86
- _dark_root()
84
+ _dark_root()
@@ -36,7 +36,7 @@
36
36
  --waline-border: 1px solid var(--waline-border-color);
37
37
  --waline-avatar-radius: 50%;
38
38
  --waline-box-shadow: none;
39
-
39
+
40
40
  .cmt-body.waline
41
41
  ondark()
42
42
  --waline-white: #000;
@@ -61,8 +61,8 @@
61
61
  font-size: 1.25em;
62
62
  color: #fff;
63
63
 
64
- if theme(dark)
64
+ :root[data-theme="dark"] &
65
65
  ondark()
66
- else if theme(auto)
66
+ :root:not([data-theme]) &
67
67
  @media (prefers-color-scheme: dark)
68
68
  ondark()
@@ -1,2 +1,2 @@
1
- img[data-fancybox]
1
+ img[data-fancybox], a[data-fancybox]
2
2
  cursor: zoom-in
@@ -108,8 +108,8 @@ _dark_mermaid()
108
108
  fill: #ccc
109
109
 
110
110
 
111
- if theme(dark)
111
+ :root[data-theme="dark"]
112
112
  _dark_mermaid()
113
- else if theme(auto)
113
+ :root:not([data-theme])
114
114
  @media (prefers-color-scheme: dark)
115
115
  _dark_mermaid()
@@ -11,7 +11,7 @@
11
11
  // 通用组件
12
12
  @import '_common/*'
13
13
  // 布局
14
- @import '_layout/*'
14
+ @import '_components/*'
15
15
 
16
16
  // 可选插件
17
17
  @import '_plugins/index'
package/source/js/main.js CHANGED
@@ -58,6 +58,20 @@ const util = {
58
58
  scrollComment: () => {
59
59
  document.getElementById('comments').scrollIntoView({behavior: "smooth"});
60
60
  },
61
+
62
+ viewportLazyload: (target, func, enabled = true) => {
63
+ if (!enabled || !("IntersectionObserver" in window)) {
64
+ func();
65
+ return;
66
+ }
67
+ const observer = new IntersectionObserver((entries) => {
68
+ if (entries[0].intersectionRatio > 0) {
69
+ func();
70
+ observer.disconnect();
71
+ }
72
+ });
73
+ observer.observe(target);
74
+ }
61
75
  }
62
76
 
63
77
  const hud = {
@@ -7,7 +7,7 @@ window.codeElements.forEach((codeElement) => {
7
7
 
8
8
  // 添加点击事件监听
9
9
  codeCopyBtn.addEventListener('click', async () => {
10
- const codeToCopy = codeElement.querySelector('code')?.textContent || '';
10
+ const codeToCopy = codeElement.querySelector('pre')?.innerText || '';
11
11
  if (navigator.clipboard) {
12
12
  try {
13
13
  await navigator.clipboard.writeText(codeToCopy);
@@ -64,7 +64,7 @@ var searchFunc = function(path, filter, wrapperId, searchId, contentId) {
64
64
  var dataTitleLowerCase = dataTitle.toLowerCase();
65
65
  var dataContent = data.content;
66
66
  var dataContentLowerCase = dataContent.toLowerCase();
67
- var dataUrl = data.path;
67
+ var dataUrl = data.path.startsWith('//') ? data.path.slice(1) : data.path; // 避免文章设置永久链接导致点击打开失败
68
68
  var indexTitle = -1;
69
69
  var indexContent = -1;
70
70
  var firstOccur = -1;
@@ -167,4 +167,4 @@ utils.jq(() => {
167
167
  }
168
168
  });
169
169
  observer.observe($resultArea, { childList: true });
170
- });
170
+ });
File without changes
File without changes
File without changes
File without changes