hexo-theme-stellar 1.29.1 → 1.30.1

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 (54) hide show
  1. package/_config.yml +29 -7
  2. package/_data/chat_users.yml +0 -0
  3. package/_data/icons.yml +3 -1
  4. package/_data/widgets.yml +7 -0
  5. package/layout/_partial/head.ejs +2 -1
  6. package/layout/_partial/main/navbar/nav_tabs_blog.ejs +10 -10
  7. package/layout/_partial/main/post_list/post_card.ejs +15 -11
  8. package/layout/_partial/scripts/defines.ejs +3 -0
  9. package/layout/_partial/scripts/services.ejs +91 -0
  10. package/layout/_partial/scripts/theme.ejs +5 -0
  11. package/layout/_partial/scripts/utils.ejs +67 -7
  12. package/layout/_partial/scripts.ejs +1 -1
  13. package/layout/_plugins/mermaid.ejs +1 -1
  14. package/layout/_plugins/scrollreveal.ejs +1 -0
  15. package/layout/_plugins/search/algolia_search.ejs +11 -12
  16. package/layout/layout.ejs +1 -1
  17. package/package.json +1 -1
  18. package/scripts/events/lib/config.js +3 -0
  19. package/scripts/events/lib/doc_tree.js +1 -6
  20. package/scripts/filters/index.js +26 -0
  21. package/scripts/generators/notebooks.js +1 -1
  22. package/scripts/generators/search.js +21 -2
  23. package/scripts/helpers/dynamic_color.js +138 -0
  24. package/scripts/tags/index.js +1 -0
  25. package/scripts/tags/lib/box.js +1 -1
  26. package/scripts/tags/lib/chat.js +515 -0
  27. package/scripts/tags/lib/folders.js +1 -1
  28. package/scripts/tags/lib/folding.js +2 -2
  29. package/scripts/tags/lib/friends.js +4 -4
  30. package/scripts/tags/lib/sites.js +1 -1
  31. package/scripts/tags/lib/video.js +7 -2
  32. package/source/css/_components/list.styl +41 -12
  33. package/source/css/_components/partial/article-banner.styl +23 -9
  34. package/source/css/_components/tag-plugins/chat.styl +621 -0
  35. package/source/css/_components/tag-plugins/friends.styl +9 -0
  36. package/source/css/_components/tag-plugins/friends_posts.styl +160 -0
  37. package/source/css/_components/tag-plugins/sites.styl +25 -0
  38. package/source/css/_components/tag-plugins/tabs.styl +5 -2
  39. package/source/css/_custom.styl +1 -0
  40. package/source/css/_defines/func.styl +7 -6
  41. package/source/css/_defines/theme.styl +38 -0
  42. package/source/css/_plugins/katex.styl +0 -1
  43. package/source/js/plugins/download-file.js +198 -0
  44. package/source/js/plugins/video.js +65 -0
  45. package/source/js/plugins/voice.js +438 -0
  46. package/source/js/search/algolia-search.js +63 -61
  47. package/source/js/services/artalk_latest_comment.js +33 -0
  48. package/source/js/services/friends.js +4 -0
  49. package/source/js/services/friends_and_posts.js +57 -0
  50. package/source/js/services/giscus_latest_comment.js +36 -0
  51. package/source/js/services/memos.js +91 -69
  52. package/source/js/services/sites.js +12 -1
  53. package/source/js/services/twikoo_latest_comment.js +47 -0
  54. package/source/js/services/waline_latest_comment.js +32 -0
@@ -39,7 +39,7 @@ module.exports = ctx => function(args, content) {
39
39
  nodes.forEach((node, i) => {
40
40
  el += '<details class="folder" index="' + (i) + '">'
41
41
  // summary
42
- el += '<summary><span>' + (node.header || '') + '</span></summary>'
42
+ el += '<summary>' + ctx.render.renderSync({text: (node.header || ''), engine: 'markdown'}) + '</summary>'
43
43
  // content
44
44
  el += '<div class="body">'
45
45
  el += ctx.render.renderSync({text: (node.body || ''), engine: 'markdown'}).split('\n').join('')
@@ -20,10 +20,10 @@ module.exports = ctx => function(args, content) {
20
20
  }
21
21
  el += '>'
22
22
  // summary
23
- el += '<summary><span>' + (args.title || '') + '</span></summary>'
23
+ el += '<summary>' + ctx.render.renderSync({text: (args.title || ''), engine: 'markdown'}) + '</summary>'
24
24
  // content
25
25
  el += '<div class="body">'
26
- el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')
26
+ el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join(' ')
27
27
  el += '</div></details>'
28
28
 
29
29
  return el
@@ -2,13 +2,13 @@
2
2
  * friends.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
- * {% friends [group] [repo:owner/repo] [api:http] %}
5
+ * {% friends [group] [repo:owner/repo] [posts:true/false] [api:http] %}
6
6
  */
7
7
 
8
8
  'use strict'
9
9
 
10
10
  module.exports = ctx => function(args) {
11
- args = ctx.args.map(args, ['repo', 'api'], ['group'])
11
+ args = ctx.args.map(args, ['repo', 'api', 'posts'], ['group'])
12
12
  var api
13
13
  if (args.api) {
14
14
  api = args.api
@@ -16,9 +16,9 @@ module.exports = ctx => function(args) {
16
16
  api = 'https://api.vlts.cc/output_data/v2/' + args.repo
17
17
  }
18
18
 
19
- var el = '<div class="tag-plugin users-wrap">'
19
+ var el = `<div class="tag-plugin ${args.posts ? 'users-posts-wrap' : 'users-wrap'}">`
20
20
  if (api) {
21
- el += `<div class="ds-friends" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
21
+ el += `<div class="ds-friends${args.posts ? '_and_posts' : ''}" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
22
22
  } else if (args.group) {
23
23
  const links = ctx.theme.config.links || {}
24
24
  el += '<div class="grid-box">'
@@ -30,7 +30,7 @@ module.exports = ctx => function(args) {
30
30
  if (item?.url && item?.title) {
31
31
  el += `<div class="grid-cell site-card">`
32
32
  el += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`
33
- el += `<img src="${item.cover || item.screenshot || ('https://api.vlts.cc/screenshot?url=' + item.url + '&width=1280&height=720')}" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;${ctx.theme.config.default.cover}&quot;;"/>`
33
+ el += `<img src="${item.cover || item.snapshot || item.screenshot || ('https://image.thum.io/get/width/1280/crop/720/' + item.url)}" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;${ctx.theme.config.default.cover}&quot;;"/>`
34
34
  el += `<div class="info">`
35
35
  el += `<img src="${item.icon || item.avatar || ctx.theme.config.default.link}" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;${item.icon || item.avatar || ctx.theme.config.default.link}&quot;;"/>`
36
36
  el += `<span class="title">${item.title}</span>`
@@ -21,8 +21,13 @@ module.exports = ctx => function (args) {
21
21
  `
22
22
  }
23
23
  if (args.youtube) {
24
- return `<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16/9};max-width:${args.width};">
25
- <iframe src="https://www.youtube.com/embed/${args.youtube}?rel=0&color=white&disablekb=1&playsinline=1&&rel=0&autoplay=${args.autoplay || '0'}" picture-in-picture="true" allowfullscreen="true" >
24
+ if(args.autoplay == 'true' || args.autoplay == '1') {
25
+ args.autoplay = '1&mute=1'
26
+ } else {
27
+ args.autoplay = '0'
28
+ }
29
+ return `<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16 / 9};max-width:${args.width};">
30
+ <iframe style="border:none" src="https://www.youtube.com/embed/${args.youtube}?rel=0&disablekb=1&playsinline=1&autoplay=${args.autoplay}" picture-in-picture="true" allowfullscreen="true" >
26
31
  </iframe>
27
32
  </div>
28
33
  `
@@ -23,13 +23,23 @@
23
23
  .post-list .post-card
24
24
  display: block
25
25
  margin: 1rem 0
26
- border-radius: $border-card
26
+ border-radius: $border-card-l
27
27
  background: var(--card)
28
28
  hoverable-card()
29
29
  overflow: hidden
30
30
  z-index: 0
31
-
32
31
  position: relative
32
+ --img-br: 100%
33
+ --img-sat: 100%
34
+ --blur-px: 1em
35
+ --blur-sat: 120%
36
+ &:hover
37
+ --img-br: 75%
38
+ --img-sat: 120%
39
+ --blur-sat: 200%
40
+ img
41
+ filter: brightness(var(--img-br)) saturate(var(--img-sat))
42
+ trans1 all
33
43
  .excerpt
34
44
  margin: 1rem 0
35
45
  @media screen and (max-width: $device-mobile)
@@ -62,9 +72,6 @@
62
72
  svg
63
73
  color: $c-red
64
74
 
65
- .post-list.post .post-card:hover
66
- img
67
- filter: brightness(50%)
68
75
 
69
76
  // common article
70
77
  .post-list .md-text
@@ -100,7 +107,23 @@
100
107
  img
101
108
  width: 100%
102
109
  object-fit: cover
103
- aspect-ratio: hexo-config('article.cover_ratio')
110
+ aspect-ratio: hexo-config('article.cover_ratio')
111
+ z-index 0
112
+ &:before
113
+ content: ''
114
+ z-index 1
115
+ position: absolute
116
+ left: 0
117
+ right: 0
118
+ height: 128px
119
+ backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
120
+ trans1 all
121
+ &[position=top]:before
122
+ top: 0
123
+ mask: linear-gradient(black, rgba(black, 0.75), transparent)
124
+ &[position=bottom]:before
125
+ bottom: 0
126
+ mask: linear-gradient(transparent, rgba(black, 0.75), black)
104
127
  .cover-info
105
128
  padding: 1.5rem 1rem
106
129
  position: absolute
@@ -108,6 +131,7 @@
108
131
  width: 'calc(100% - %s * 2)' % 1rem
109
132
  --text-banner: white
110
133
  color: var(--text-banner)
134
+ z-index: 2
111
135
  &[position=top]
112
136
  top: 0
113
137
  background-image: linear-gradient(rgba(0,0,0,0.2),rgba(0,0,0,0))
@@ -116,20 +140,25 @@
116
140
  background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.2))
117
141
  div+div
118
142
  margin-top: 4px
119
- .cap
120
- font-size: $fs-13
143
+ .text
121
144
  color: unset
122
- .title
145
+ trans1 all
146
+ text-shadow: 0 2px 4px rgba(0,0,0,0.2)
147
+ .topic
148
+ font-size: $fs-13
149
+ .headline
123
150
  font-weight: 500
124
151
  font-size: $fsh3
152
+ .caption
153
+ font-size: $fs-14
125
154
  @media screen and (max-width: $device-mobile)
126
155
  padding: 1rem
127
156
  div+div
128
157
  margin-top: 2px
129
- .title
158
+ .headline
130
159
  font-size: $fsh4
131
- .cap
132
- font-size: $fs-12
160
+ .caption
161
+ font-size: $fs-13
133
162
  h2
134
163
  margin: .25rem 0
135
164
  font-size: $fsh4
@@ -31,20 +31,34 @@
31
31
  // 动画配置
32
32
  .article.banner
33
33
  .bg+.content
34
- trans1 all
35
34
  --blur-bg: rgba(black, 0)
36
35
  --blur-px: 0px
37
36
  --blur-sat: 100%
38
- background: var(--blur-bg)
39
- @supports ((-webkit-backdrop-filter:blur(var(--blur-px))) or (backdrop-filter:blur(var(--blur-px))))
40
- background: var(--blur-bg)
41
- backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
42
- -webkit-backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
43
- &:hover
44
- .bg+.content
37
+ &:hover
45
38
  --blur-bg: rgba(black, 0.1)
46
- --blur-px: 20px
39
+ --blur-px: 1em
47
40
  --blur-sat: 150%
41
+ background: var(--blur-bg)
42
+ trans1 all
43
+ &:before,&:after
44
+ content: ''
45
+ position: absolute
46
+ z-index 0
47
+ left: 0
48
+ width: 100%
49
+ backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
50
+ trans1 all
51
+ &:before
52
+ top: 0
53
+ height: 4rem
54
+ mask: linear-gradient(black, rgba(black, 0.75), transparent)
55
+ &:after
56
+ bottom: 0
57
+ height: 5rem
58
+ mask: linear-gradient(transparent, rgba(black, 0.75), black)
59
+ .top,.bottom
60
+ z-index 1
61
+
48
62
 
49
63
  .article.banner
50
64
  --button-hover-bg: rgba(black, 0.05)