hexo-theme-stellar 1.26.8 → 1.28.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 (154) hide show
  1. package/_config.yml +139 -95
  2. package/_data/icons.yml +8 -1
  3. package/_data/widgets.yml +19 -7
  4. package/languages/en.yml +5 -2
  5. package/languages/zh-CN.yml +4 -1
  6. package/languages/zh-TW.yml +5 -2
  7. package/layout/404.ejs +1 -1
  8. package/layout/_partial/{plugins/comments → comments}/artalk/script.ejs +2 -2
  9. package/layout/_partial/{plugins/comments/utterances → comments/giscus}/layout.ejs +5 -2
  10. package/layout/_partial/{plugins/comments → comments}/giscus/script.ejs +1 -4
  11. package/layout/_partial/{plugins/comments → comments}/layout.ejs +14 -9
  12. package/layout/_partial/{plugins/comments → comments}/twikoo/script.ejs +1 -1
  13. package/layout/_partial/comments/waline/script.ejs +43 -0
  14. package/layout/_partial/head.ejs +2 -2
  15. package/layout/_partial/main/article/article_footer.ejs +1 -1
  16. package/layout/_partial/main/footer.ejs +1 -1
  17. package/layout/_partial/main/navbar/article_banner.ejs +81 -17
  18. package/layout/_partial/main/navbar/ghinfo.ejs +1 -1
  19. package/layout/_partial/main/post_list/post_card.ejs +1 -1
  20. package/layout/_partial/menubtn.ejs +6 -3
  21. package/layout/_partial/scripts/defines.ejs +31 -0
  22. package/layout/_partial/scripts/services.ejs +29 -0
  23. package/layout/_partial/scripts/sidebar.ejs +25 -0
  24. package/layout/_partial/scripts/utils.ejs +158 -0
  25. package/layout/_partial/scripts.ejs +32 -0
  26. package/layout/_partial/sidebar/{index.ejs → index_leftbar.ejs} +22 -20
  27. package/layout/_partial/sidebar/index_rightbar.ejs +84 -0
  28. package/layout/_partial/sidebar/logo.ejs +1 -1
  29. package/layout/_partial/widgets/author.ejs +37 -0
  30. package/layout/_partial/widgets/components/edit.ejs +24 -0
  31. package/layout/_partial/widgets/ghissues.ejs +1 -1
  32. package/layout/_partial/widgets/ghrepo.ejs +2 -2
  33. package/layout/_partial/widgets/ghuser.ejs +2 -2
  34. package/layout/_partial/widgets/markdown.ejs +1 -1
  35. package/layout/_partial/widgets/recent.ejs +1 -5
  36. package/layout/_partial/widgets/related.ejs +1 -1
  37. package/layout/_partial/widgets/timeline.ejs +1 -1
  38. package/layout/_partial/widgets/toc.ejs +38 -85
  39. package/layout/_partial/widgets/tree.ejs +71 -0
  40. package/layout/_plugins/copycode.ejs +13 -0
  41. package/layout/_plugins/fancybox.ejs +32 -0
  42. package/layout/_plugins/heti.ejs +21 -0
  43. package/layout/_plugins/index.ejs +24 -0
  44. package/layout/_plugins/lazyload.ejs +21 -0
  45. package/layout/{_partial/plugins/parser/mathjax/script.ejs → _plugins/mathjax.ejs} +1 -1
  46. package/layout/_plugins/mermaid.ejs +29 -0
  47. package/layout/_plugins/preload.ejs +9 -0
  48. package/layout/_plugins/scrollreveal.ejs +15 -0
  49. package/layout/_plugins/search/algolia_search.ejs +13 -0
  50. package/layout/_plugins/search/local_search.ejs +8 -0
  51. package/layout/_plugins/swiper.ejs +26 -0
  52. package/layout/_plugins/tianli_gpt.ejs +14 -0
  53. package/layout/archive.ejs +9 -2
  54. package/layout/layout.ejs +9 -6
  55. package/layout/page.ejs +2 -10
  56. package/package.json +1 -1
  57. package/scripts/events/lib/doc_tree.js +8 -8
  58. package/scripts/events/lib/topic_tree.js +3 -0
  59. package/scripts/generators/author.js +3 -2
  60. package/scripts/helpers/parse_config.js +6 -5
  61. package/scripts/tags/lib/albums.js +2 -2
  62. package/scripts/tags/lib/button.js +1 -1
  63. package/scripts/tags/lib/emoji.js +1 -1
  64. package/scripts/tags/lib/friends.js +1 -1
  65. package/scripts/tags/lib/icon.js +10 -5
  66. package/scripts/tags/lib/link.js +2 -2
  67. package/scripts/tags/lib/md.js +1 -1
  68. package/scripts/tags/lib/posters.js +2 -2
  69. package/scripts/tags/lib/sites.js +1 -1
  70. package/scripts/tags/lib/timeline.js +2 -2
  71. package/source/css/_common/button.styl +8 -2
  72. package/source/css/_common/device.styl +39 -12
  73. package/source/css/_custom.styl +15 -16
  74. package/source/css/_defines/const.styl +1 -1
  75. package/source/css/_defines/func.styl +14 -4
  76. package/source/css/_defines/theme.styl +38 -27
  77. package/source/css/_layout/layout.styl +62 -27
  78. package/source/css/_layout/list.styl +1 -1
  79. package/source/css/_layout/main.styl +1 -4
  80. package/source/css/_layout/md.styl +16 -2
  81. package/source/css/_layout/pages/archives.styl +4 -0
  82. package/source/css/_layout/partial/article-banner.styl +14 -15
  83. package/source/css/_layout/partial/article-footer.styl +0 -5
  84. package/source/css/_layout/partial/footer.styl +9 -6
  85. package/source/css/_layout/partial/related.styl +4 -0
  86. package/source/css/_layout/sidebar/footer.styl +3 -1
  87. package/source/css/_layout/sidebar/logo.styl +3 -1
  88. package/source/css/_layout/sidebar/menu.styl +1 -1
  89. package/source/css/_layout/sidebar/nav-area.styl +1 -1
  90. package/source/css/_layout/sidebar/sidebar.styl +25 -16
  91. package/source/css/_layout/tag-plugins/banner.styl +1 -8
  92. package/source/css/_layout/tag-plugins/common.styl +10 -5
  93. package/source/css/_layout/tag-plugins/emoji.styl +1 -0
  94. package/source/css/_layout/tag-plugins/icon.styl +6 -0
  95. package/source/css/_layout/tag-plugins/image.styl +1 -1
  96. package/source/css/_layout/tag-plugins/quot.styl +1 -1
  97. package/source/css/_layout/tag-plugins/timeline.styl +26 -27
  98. package/source/css/_layout/widgets/ghrepo.styl +1 -1
  99. package/source/css/_layout/widgets/ghuser.styl +9 -5
  100. package/source/css/_layout/widgets/list.styl +4 -3
  101. package/source/css/_layout/widgets/related.styl +0 -1
  102. package/source/css/_layout/widgets/timeline.styl +27 -21
  103. package/source/css/_layout/widgets/toc.styl +182 -0
  104. package/source/css/_layout/widgets/tree.styl +0 -0
  105. package/source/css/_layout/widgets/widgets.styl +26 -7
  106. package/source/css/_plugins/comments/twikoo.styl +103 -59
  107. package/source/css/_plugins/comments/waline.styl +13 -10
  108. package/source/css/_plugins/index.styl +2 -0
  109. package/source/css/_plugins/katex.styl +5 -0
  110. package/source/css/_plugins/mermaid.styl +49 -59
  111. package/source/css/_plugins/tianli_gpt.styl +208 -151
  112. package/source/js/main.js +52 -251
  113. package/source/js/plugins/copycode.js +28 -41
  114. package/source/js/search/algolia-search.js +75 -0
  115. package/source/js/search/local-search.js +32 -0
  116. package/source/js/services/fcircle.js +36 -0
  117. package/source/js/services/friends.js +27 -0
  118. package/source/js/services/ghinfo.js +33 -0
  119. package/source/js/services/mdrender.js +10 -0
  120. package/source/js/services/memos.js +73 -0
  121. package/source/js/services/siteinfo.js +38 -0
  122. package/source/js/services/sites.js +30 -0
  123. package/source/js/services/timeline.js +106 -0
  124. package/source/js/services/weibo.js +60 -0
  125. package/layout/_partial/main/navbar/article_top_area.ejs +0 -35
  126. package/layout/_partial/main/navbar/author_banner.ejs +0 -29
  127. package/layout/_partial/plugins/ai/tianli_gpt.ejs +0 -9
  128. package/layout/_partial/plugins/comments/waline/script.ejs +0 -39
  129. package/layout/_partial/plugins/parser/head.ejs +0 -3
  130. package/layout/_partial/plugins/parser/katex/head.ejs +0 -3
  131. package/layout/_partial/plugins/parser/katex/script.ejs +0 -4
  132. package/layout/_partial/plugins/parser/mermaid/script.ejs +0 -29
  133. package/layout/_partial/plugins/parser/script.ejs +0 -9
  134. package/layout/_partial/scripts/index.ejs +0 -176
  135. package/source/css/_layout/widgets/toc_blog.styl +0 -3
  136. package/source/css/_layout/widgets/toc_common.styl +0 -92
  137. package/source/css/_layout/widgets/toc_wiki.styl +0 -62
  138. package/source/js/plugins/fcircle.js +0 -92
  139. package/source/js/plugins/friends.js +0 -84
  140. package/source/js/plugins/ghinfo.js +0 -85
  141. package/source/js/plugins/linkcard.js +0 -48
  142. package/source/js/plugins/marked.js +0 -50
  143. package/source/js/plugins/memos.js +0 -132
  144. package/source/js/plugins/sites.js +0 -87
  145. package/source/js/plugins/timeline.js +0 -162
  146. package/source/js/plugins/weibo.js +0 -116
  147. /package/layout/_partial/{plugins/comments → comments}/artalk/layout.ejs +0 -0
  148. /package/layout/_partial/{plugins/comments → comments}/beaudar/layout.ejs +0 -0
  149. /package/layout/_partial/{plugins/comments → comments}/beaudar/script.ejs +0 -0
  150. /package/layout/_partial/{plugins/comments → comments}/script.ejs +0 -0
  151. /package/layout/_partial/{plugins/comments → comments}/twikoo/layout.ejs +0 -0
  152. /package/layout/_partial/{plugins/comments/giscus → comments/utterances}/layout.ejs +0 -0
  153. /package/layout/_partial/{plugins/comments → comments}/utterances/script.ejs +0 -0
  154. /package/layout/_partial/{plugins/comments → comments}/waline/layout.ejs +0 -0
@@ -0,0 +1,8 @@
1
+ <script>
2
+ window.addEventListener('DOMContentLoaded', (event) => {
3
+ ctx.search = {
4
+ path: `<%- conf.path || '/search.json' %>`,
5
+ }
6
+ utils.js('/js/search/local-search.js', { defer: true });
7
+ });
8
+ </script>
@@ -0,0 +1,26 @@
1
+ <script>
2
+ window.addEventListener('DOMContentLoaded', (event) => {
3
+ const swiper_api = document.getElementById('swiper-api');
4
+ if (swiper_api != undefined) {
5
+ utils.css(`<%- conf.css %>`);
6
+ utils.js(`<%- conf.js %>`, { defer: true }).then(function () {
7
+ const effect = swiper_api.getAttribute('effect') || '';
8
+ var swiper = new Swiper('.swiper#swiper-api', {
9
+ slidesPerView: 'auto',
10
+ spaceBetween: 8,
11
+ centeredSlides: true,
12
+ effect: effect,
13
+ rewind: true,
14
+ pagination: {
15
+ el: '.swiper-pagination',
16
+ clickable: true,
17
+ },
18
+ navigation: {
19
+ nextEl: '.swiper-button-next',
20
+ prevEl: '.swiper-button-prev',
21
+ },
22
+ });
23
+ })
24
+ }
25
+ });
26
+ </script>
@@ -0,0 +1,14 @@
1
+ <%
2
+ const { field } = theme.plugins.tianli_gpt;
3
+ const matchesField = field === 'all' || field === layout || (field === 'wiki' && page.wiki) || (field === 'topic' && page.topic);
4
+ if (matchesField) { %>
5
+ <script defer src="<%- theme.plugins.tianli_gpt?.js %>"></script>
6
+ <script defer>
7
+ window.addEventListener('DOMContentLoaded', (event) => {
8
+ new ChucklePostAI(Object.assign({
9
+ el: 'article.content',
10
+ css: `/css/_plugins/tianli_gpt`
11
+ }, JSON.parse(`<%- JSON.stringify(theme.plugins.tianli_gpt) %>`)))
12
+ });
13
+ </script>
14
+ <% } %>
@@ -8,14 +8,21 @@ if (page.author) {
8
8
  }
9
9
  function layoutArchiveList() {
10
10
  var el = ''
11
+ var cls = ''
11
12
  if (page.author) {
12
13
  page.title = page.author.name
13
- el += partial('_partial/main/navbar/author_banner')
14
+ page.banner = page.author.banner
15
+ page.banner_info = {
16
+ avatar: page.author.avatar,
17
+ subtitle: page.author.description
18
+ }
19
+ el += partial('_partial/main/navbar/article_banner')
20
+ cls += ' author'
14
21
  } else {
15
22
  page.title = __('btn.archives')
16
23
  el += partial('_partial/main/navbar/nav_tabs_blog')
17
24
  }
18
- el += `<div class="post-list archives">`
25
+ el += `<div class="post-list${cls} archives">`
19
26
  var years = []
20
27
  const posts = page.author != null ? site.posts.filter(p => (p.author || theme.default_author.id) == page.author.id) : site.posts
21
28
  posts.sort('date', -1).each(function(post) {
package/layout/layout.ejs CHANGED
@@ -42,22 +42,25 @@ html += `<html lang="${page.lang}">`
42
42
  html += `<body>`
43
43
  html += site_background
44
44
  html += partial('_partial/cover/index')
45
- html += `<div class="l_body ${page_type} ${article_type}" id="start" layout="${page.layout}" ${indent ? 'text-indent' : ''}>`
45
+ html += `<div class="l_body s:aa ${page_type} ${article_type}" id="start" layout="${page.layout}" ${indent ? 'text-indent' : ''}>`
46
46
  html += `<aside class="l_left">`
47
- html += `<div class="sidebar-container${theme.style.sidebar?.blur ? ' sidebar-blur' : ''}">`
48
- html += partial('_partial/sidebar/index')
47
+ html += `<div class="leftbar-container${theme.style.leftbar?.blur ? ' leftbar-blur' : ''}">`
48
+ html += partial('_partial/sidebar/index_leftbar')
49
49
  html += `</div>`
50
50
  html += `</aside>`
51
51
  html += `<div class="l_main" id="main">`
52
52
  html += partial('_partial/sidebar/logo', {where: 'main'})
53
53
  html += body
54
54
  html += partial('_partial/main/footer')
55
- html += partial('_partial/menubtn')
56
- html += `<div class="main-mask" onclick="sidebar.toggle()"></div>`
55
+ html += `<div class="main-mask" onclick="sidebar.dismiss()"></div>`
57
56
  html += `</div>`
57
+ html += `<aside class="l_right">`
58
+ html += partial('_partial/sidebar/index_rightbar')
59
+ html += `</aside>`
60
+ html += partial('_partial/menubtn')
58
61
  html += `</div>`
59
62
  html += `<div class="scripts">`
60
- html += partial('_partial/scripts/index')
63
+ html += partial('_partial/scripts')
61
64
  html += `</div>`
62
65
  html += `</body>`
63
66
  html += `</html>`
package/layout/page.ejs CHANGED
@@ -1,9 +1,7 @@
1
1
  <%
2
2
  const { layout } = page
3
3
  // 是否使用 Heti 布局插件
4
- const isUsingHeti = theme.plugins.heti && theme.plugins.heti.enable
5
- // 是否使用 TianliGPT 插件
6
- const isUsingTianliGPT = theme.plugins.tianli_gpt.enable && ['all', page.layout].includes(theme.plugins.tianli_gpt.field)
4
+ const isUsingHeti = theme.plugins.heti?.enable
7
5
 
8
6
  // 默认的 menu_id
9
7
  if (page.menu_id == null) {
@@ -27,9 +25,6 @@ function articleClass() {
27
25
  if (isUsingHeti) {
28
26
  str += ' heti'
29
27
  }
30
- if (isUsingTianliGPT) {
31
- str += ' '
32
- }
33
28
  return str
34
29
  }
35
30
 
@@ -52,13 +47,10 @@ function layoutDiv() {
52
47
  if (layout === 'post' || page.wiki) {
53
48
  el += partial('_partial/main/article/read_next')
54
49
  }
55
- if (isUsingTianliGPT) {
56
- el += partial('_partial/plugins/ai/tianli_gpt')
57
- }
58
50
  if (layout === 'post') {
59
51
  el += partial('_partial/main/article/related_posts')
60
52
  }
61
- el += partial('_partial/plugins/comments/layout')
53
+ el += partial('_partial/comments/layout')
62
54
  return el
63
55
  }
64
56
  %>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.26.8",
3
+ "version": "1.28.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -30,8 +30,8 @@ function getWikiObject(ctx) {
30
30
  if ((typeof obj.tags == 'string') && obj.tags.constructor == String) {
31
31
  obj.tags = [obj.tags]
32
32
  }
33
- if ((typeof obj.toc == 'object') && obj.toc.constructor == Array) {
34
- obj.toc = { '': obj.toc }
33
+ if ((typeof obj.tree == 'object') && obj.tree.constructor == Array) {
34
+ obj.tree = { '': obj.tree }
35
35
  }
36
36
  obj.id = newKey
37
37
  if (obj.sort == null) {
@@ -108,9 +108,9 @@ module.exports = ctx => {
108
108
  // 首页
109
109
  // 未特别指定首页时,获取TOC第一页作为首页
110
110
  var homepage = item.homepage
111
- if (homepage == null && item.toc != null) {
112
- for (let id of Object.keys(item.toc)) {
113
- const sec = item.toc[id]
111
+ if (homepage == null && item.tree != null) {
112
+ for (let id of Object.keys(item.tree)) {
113
+ const sec = item.tree[id]
114
114
  for (let key of sec) {
115
115
  let hs = sub_pages.filter(p => p.path_key == item.base_dir + key)
116
116
  if (hs.length > 0) {
@@ -134,11 +134,11 @@ module.exports = ctx => {
134
134
  // 内页分组
135
135
  var sections = []
136
136
  var others = sub_pages
137
- if (item.toc) {
137
+ if (item.tree) {
138
138
  // 根据配置设置顺序
139
- for (let title of Object.keys(item.toc)) {
139
+ for (let title of Object.keys(item.tree)) {
140
140
  var sec = { title: title, pages: []}
141
- for (let key of item.toc[title]) {
141
+ for (let key of item.tree[title]) {
142
142
  sec.pages = sec.pages.concat(sub_pages.filter(p => p.path_key == item.base_dir + key))
143
143
  others = others.filter(p => p.path_key != item.base_dir + key)
144
144
  }
@@ -13,6 +13,9 @@ function getTopicTree(ctx) {
13
13
  const data = ctx.locals.get('data')
14
14
  var list = []
15
15
  for (let key of Object.keys(data)) {
16
+ if (key.endsWith('.DS_Store')) {
17
+ continue
18
+ }
16
19
  if (key.startsWith('topic/') && key.length > 5) {
17
20
  let newKey = key.replace('topic/', '')
18
21
  let obj = data[key]
@@ -16,8 +16,9 @@ hexo.extend.generator.register('author', function (locals) {
16
16
  layout: ['archive'],
17
17
  data: {
18
18
  author: author,
19
- sidebar: site_tree.author.sidebar,
20
- menu_id: site_tree.author.menu_id
19
+ leftbar: site_tree.author.leftbar,
20
+ menu_id: site_tree.author.menu_id,
21
+ breadcrumb: false
21
22
  }
22
23
  })
23
24
  }
@@ -9,17 +9,18 @@ hexo.extend.helper.register('md_text', function(args) {
9
9
  if (args == undefined) {
10
10
  return ''
11
11
  }
12
+ const { config } = hexo
13
+ args = args.replace('{config.title}', config.title)
14
+ args = args.replace('{config.subtitle}', config.subtitle)
15
+ args = args.replace('{config.avatar}', config.avatar)
12
16
  let tmp = args.split('](')
13
17
  if (tmp.length > 1) {
14
18
  tmp = tmp[0]
15
19
  if (tmp.length > 1) {
16
20
  tmp = tmp.substring(1, tmp.length)
17
21
  }
18
- }
19
- if (tmp == 'config.title' || tmp == '${config.title}') {
20
- tmp = hexo.config.title
21
- } else if (tmp == 'config.avatar' || tmp == '${config.avatar}') {
22
- tmp = hexo.config.avatar
22
+ } else {
23
+ tmp = args
23
24
  }
24
25
  return tmp
25
26
  })
@@ -22,7 +22,7 @@ module.exports = ctx => function(args) {
22
22
  var el = ''
23
23
  el += `<div class="tag-plugin albums-wrap">`
24
24
  if (api) {
25
- el += `<div class="stellar-friends-api" api="${api}"><div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}></div></div>`
25
+ el += `<div class="ds-friends" api="${api}"><div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}></div></div>`
26
26
  } else if (args.group) {
27
27
  const links = ctx.theme.config.links || {}
28
28
  el += `<div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}>`
@@ -30,7 +30,7 @@ module.exports = ctx => function(args) {
30
30
  if (item?.url) {
31
31
  el += `<div class="grid-cell album-card">`
32
32
  el += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`
33
- el += `<img src="${item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;${ctx.theme.config.default.cover}&quot;;"/>`
33
+ el += `<img src="${item.cover || item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;${ctx.theme.config.default.cover}&quot;;"/>`
34
34
  el += `<div class="image-meta">`
35
35
  if (item.title) {
36
36
  el += `<span class="image-caption">${item.title}</span>`
@@ -22,7 +22,7 @@ module.exports = ctx => function(args) {
22
22
  args.text = `${args.text} ${arr.join(' ')}`
23
23
  }
24
24
  if (args.color == null) {
25
- args.color = 'theme'
25
+ args.color = ctx.theme.config.tag_plugins.button.default_color
26
26
  }
27
27
  var el = ''
28
28
  el += '<a class="tag-plugin colorful button"'
@@ -27,7 +27,7 @@ module.exports = ctx => function(args) {
27
27
  }
28
28
  }
29
29
  if (config[args.source] && args.name) {
30
- let url = config[args.source].replace('${name}', args.name)
30
+ let url = config[args.source].replace('{name}', args.name)
31
31
  el += '<img no-lazy="" class="inline"'
32
32
  el += ' src="' + url + '"'
33
33
  if (args.height) {
@@ -18,7 +18,7 @@ module.exports = ctx => function(args) {
18
18
 
19
19
  var el = '<div class="tag-plugin users-wrap">'
20
20
  if (api) {
21
- el += `<div class="stellar-friends-api" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
21
+ el += `<div class="ds-friends" ${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">'
@@ -9,19 +9,24 @@
9
9
  'use strict'
10
10
 
11
11
  module.exports = ctx => function(args) {
12
- args = ctx.args.map(args, ['color', 'style'], ['key'])
12
+ args = ctx.args.map(args, ['color', 'style'], ['key', 'text'])
13
13
  if (args.color == null) {
14
14
  args.color = ctx.theme.config.tag_plugins.icon.default_color
15
15
  }
16
16
  var el = ''
17
- el += '<span class="tag-plugin colorful icon"'
18
- el += ' ' + ctx.args.joinTags(args, ['color']).join(' ')
19
- el += '>'
17
+ if (args.text) {
18
+ el += `<div class="tag-plugin icon-wrap">`
19
+ }
20
+ el += `<span class="tag-plugin icon colorful" ${ctx.args.joinTags(args, ['color']).join(' ')}>`
20
21
  var more = ''
21
22
  if (args.style) {
22
23
  more += `style="${args.style}"`
23
24
  }
24
25
  el += ctx.utils.icon(args.key, more)
25
- el += '</span>'
26
+ el += `</span>`
27
+ if (args.text) {
28
+ el += `<span class="text">${args.text}</span>`
29
+ el += '</div>'
30
+ }
26
31
  return el
27
32
  }
@@ -14,9 +14,9 @@ module.exports = ctx => function(args) {
14
14
  return '';
15
15
  }
16
16
  const url = full_url_for(args.url)
17
- args.api = ctx.theme.config.tag_plugins.linkcard.api
17
+ args.api = ctx.theme.config.data_services.siteinfo?.api
18
18
  if (args.api) {
19
- args.api = args.api.replace('${href}', url)
19
+ args.api = args.api.replace('{href}', url)
20
20
  }
21
21
  var autofill = []
22
22
  if (!args.title) {
@@ -15,6 +15,6 @@ module.exports = ctx => function(args) {
15
15
  args = ctx.args.map(args, [''], ['src'])
16
16
  const md_id = "md_" + ++md_index
17
17
  return `
18
- <div class="stellar-marked-api md-marked" src="${args.src}" id="${md_id}"></div>
18
+ <div class="ds-mdrender" src="${args.src}" id="${md_id}"></div>
19
19
  `
20
20
  }
@@ -22,7 +22,7 @@ module.exports = ctx => function(args) {
22
22
  var el = ''
23
23
  el += `<div class="tag-plugin posters-wrap">`
24
24
  if (api) {
25
- el += `<div class="stellar-friends-api" api="${api}"><div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}></div></div>`
25
+ el += `<div class="ds-friends" api="${api}"><div class="tag-plugin gallery grid-box" layout="grid" ratio="square" ${ctx.args.joinTags(args, ['size']).join(' ')}></div></div>`
26
26
  } else if (args.group) {
27
27
  const links = ctx.theme.config.links || {}
28
28
  el += `<div class="tag-plugin gallery grid-box" layout="grid" ratio="portrait" ${ctx.args.joinTags(args, ['size']).join(' ')}>`
@@ -30,7 +30,7 @@ module.exports = ctx => function(args) {
30
30
  if (item?.url) {
31
31
  el += `<div class="grid-cell poster-card">`
32
32
  el += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`
33
- el += `<img src="${item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;${ctx.theme.config.default.cover}&quot;;"/>`
33
+ el += `<img src="${item.cover || item.icon || item.avatar || ctx.theme.config.default.cover}" onerror="javascript:this.removeAttribute(&quot;data-src&quot;);this.src=&quot;${ctx.theme.config.default.cover}&quot;;"/>`
34
34
  el += `<div class="image-meta">`
35
35
  if (item.title) {
36
36
  el += `<span class="image-caption">${item.title}</span>`
@@ -18,7 +18,7 @@ module.exports = ctx => function(args) {
18
18
 
19
19
  var el = '<div class="tag-plugin sites-wrap">'
20
20
  if (api) {
21
- el += '<div class="stellar-sites-api"'
21
+ el += '<div class="ds-sites"'
22
22
  el += ' api="' + api + '"'
23
23
  el += '>'
24
24
  el += '<div class="grid-box"></div>'
@@ -18,7 +18,7 @@ function layoutNodeTitle(ctx, content) {
18
18
  var el = ''
19
19
  el += '<div class="header">'
20
20
  if (content && content.length > 0) {
21
- el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')
21
+ el += content
22
22
  }
23
23
  el += '</div>'
24
24
  return el
@@ -41,7 +41,7 @@ module.exports = ctx => function(args, content = '') {
41
41
  args.type = 'timeline'
42
42
  }
43
43
  if (args.api && args.api.length > 0) {
44
- el += '<div class="tag-plugin timeline stellar-' + args.type + '-api"'
44
+ el += `<div class="tag-plugin timeline ds-${args.type}"`
45
45
  el += ' ' + ctx.args.joinTags(args, ['api', 'user', 'limit', 'hide', 'avatar']).join(' ')
46
46
  el += '>'
47
47
  } else {
@@ -27,7 +27,7 @@ a[onclick]:hover
27
27
 
28
28
  a.button.start.gradient
29
29
  position relative
30
- @media (prefers-color-scheme: dark)
30
+ ondark()
31
31
  transition: 0.38s ease-out
32
32
  z-index: 0
33
33
  background: convert(hexo-config('style.gradient.start'))
@@ -58,4 +58,10 @@ a.button.start.gradient
58
58
  transition: 0.38s ease-out
59
59
  &:hover:after
60
60
  filter: blur(36px)
61
- opacity 1
61
+ opacity 1
62
+
63
+ if theme(dark)
64
+ ondark()
65
+ else if theme(auto)
66
+ @media (prefers-color-scheme: dark)
67
+ ondark()
@@ -9,25 +9,32 @@
9
9
 
10
10
  .float-panel
11
11
  position: sticky
12
+ grid-column-end: span 3
12
13
  right: 0
13
14
  bottom: 2rem
14
15
  float: right
15
16
  z-index: 10
16
17
  display: flex
17
- border-radius: 2rem
18
+ flex-direction: column
19
+ border-radius: $border-bar
20
+ margin-left: auto
18
21
  margin-right: 1rem
22
+ @media screen and (min-width: $device-mobile-max)
23
+ margin-right: 2rem
19
24
  overflow: hidden
20
25
  --blur-px: 16px
21
26
  --blur-bg: alpha(#fff, .4)
22
27
  trans1: all
23
- if hexo-config('style.darkmode') == 'auto'
24
- @media (prefers-color-scheme: dark)
25
- --blur-bg: alpha(#000, .4)
26
- if hexo-config('style.darkmode') == 'always'
28
+ ondark()
27
29
  --blur-bg: alpha(#000, .4)
30
+ if theme(dark)
31
+ ondark()
32
+ else if theme(auto)
33
+ @media (prefers-color-scheme: dark)
34
+ ondark()
28
35
 
29
36
  // 侧边栏弹出按钮
30
- .sidebar-toggle.mobile
37
+ .float-panel button
31
38
  cursor: pointer
32
39
  color: var(--text)
33
40
  background: none
@@ -41,8 +48,17 @@
41
48
  trans1 transform
42
49
  width: auto
43
50
  height: 28px
51
+
44
52
  // 侧边栏弹出后
45
- .l_body.mobile.sidebar .sidebar-toggle.mobile
53
+ .l_body[leftbar] .float-panel, .l_body[rightbar] .float-panel
54
+ box-shadow: 0 0 4px -1px $color-theme, 0 0 16px -4px $color-theme, 0 0 32px -12px $color-theme, 0 0 128px -32px $color-theme
55
+
56
+ .l_body[leftbar] .float-panel button.leftbar-toggle
57
+ background: var(--alpha100)
58
+
59
+ .l_body[leftbar] .float-panel button.leftbar-toggle
60
+ color: $color-theme
61
+ border-color: var(--block-border)
46
62
  svg g
47
63
  fill: currentColor
48
64
  fill-opacity: 0.3
@@ -50,8 +66,19 @@
50
66
  transform: translateX(2px)
51
67
 
52
68
 
53
- .l_body.mobile.sidebar
54
- .sidebar-toggle.mobile
55
- background: var(--card)
56
- color: $color-hover
57
- border-color: var(--block-border)
69
+ // 侧边栏有内容时才显示弹出按钮
70
+ .l_body .l_right:empty+.float-panel button.rightbar-toggle
71
+ display: none !important
72
+
73
+ .l_body[rightbar] .float-panel button.rightbar-toggle
74
+ background: var(--alpha100)
75
+
76
+ .l_body[rightbar] .float-panel button.rightbar-toggle
77
+ color: $color-theme
78
+ border-color: var(--block-border)
79
+ svg g
80
+ fill: currentColor
81
+ fill-opacity: 0.3
82
+ path#sep
83
+ transform: translateX(2px)
84
+
@@ -4,7 +4,6 @@
4
4
  $color-theme = convert(hexo-config('style.color.theme'))
5
5
  $color-accent = convert(hexo-config('style.color.accent'))
6
6
  $color-link = convert(hexo-config('style.color.link'))
7
- $color-button = convert(hexo-config('style.color.button'))
8
7
  $color-hover = convert(hexo-config('style.color.hover'))
9
8
 
10
9
  // 动态颜色
@@ -13,12 +12,6 @@ $color-block = convert(hexo-config('style.color.block'))
13
12
  $color-code = convert(hexo-config('style.color.code'))
14
13
  $color-text = convert(hexo-config('style.color.text'))
15
14
 
16
- // @font-face
17
- // font-family: 'Dosis'
18
- // src: url('https://gcore.jsdelivr.net/gh/volantis-x/cdn-fonts@20.5.30/Dosis/Dosis-Medium.ttf')
19
- // font-weight: normal
20
- // font-style: normal
21
-
22
15
  $ff-body = system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
23
16
  $ff-codeblock = Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif
24
17
  $ff-code = $ff-codeblock
@@ -48,7 +41,7 @@ $fs-body = convert(hexo-config('style.font-size.body'))
48
41
  $fs-code = convert(hexo-config('style.font-size.code'))
49
42
  $fs-codeblock = convert(hexo-config('style.font-size.codeblock'))
50
43
 
51
- $fsh1 = 'calc(%s + 11px)' % $fs-body
44
+ $fsh1 = 'calc(%s + 9px)' % $fs-body
52
45
  $fsh2 = 'calc(%s + 11px)' % $fs-body
53
46
  $fsh3 = 'calc(%s + 7px)' % $fs-body
54
47
  $fsh4 = 'calc(%s + 4px)' % $fs-body
@@ -67,31 +60,37 @@ $border-button = 4px
67
60
 
68
61
  // 可以动态变化的属性
69
62
  :root
70
- --width-left: 288px
71
63
  --width-main: 720px
72
64
  --fsp: $fs-body
73
65
  --fsh2: 'calc(%s + 11px)' % var(--fsp)
74
66
  --fsh3: 'calc(%s + 7px)' % var(--fsp)
75
67
  --fsh4: 'calc(%s + 4px)' % var(--fsp)
76
68
 
77
- --gap-l: 16px
69
+ // 侧边栏文字内容宽度
70
+ --side-content-width: 224px
71
+ // 元素轮廓到容器边缘的间距
72
+ --gap-margin: 16px
73
+ // 元素文本内容到元素自身的轮廓的间距
74
+ --gap-padding: 16px
75
+
78
76
  --gap-p: 'calc(%s + 4px)' % $fs-body // gap for paragraph
79
77
  --gap-p-compact: 'calc(%s * 0.75)' % $fs-body
80
78
  // desktop 2k or larger
81
79
  @media screen and (min-width: $device-2k)
82
- --gap-l: 32px
83
- --width-left: 352px
84
80
  --width-main: 780px
85
81
  // desktop 4k or larger
86
82
  @media screen and (min-width: $device-4k)
87
83
  --width-main: 860px
88
- --gap-l: 64px
89
84
  // iPad 竖屏
90
85
  @media screen and (max-width: $device-tablet)
91
- --width-left: 252px
92
- // iPad 竖屏
86
+ --side-content-width: 188px
93
87
  @media screen and (max-width: $device-mobile-max)
94
- --width-left: 288px
88
+ --side-content-width: 224px
89
+
90
+ // 动态计算值
91
+ :root
92
+ // 元素文本内容到容器边缘的间距
93
+ --gap-max: calc(var(--gap-margin) + var(--gap-padding))
95
94
 
96
95
  // 文章布局风格
97
96
  .l_body.story
@@ -4,7 +4,7 @@ $device-mobile-425 = 425px
4
4
  $device-mobile = 500px
5
5
  $device-mobile-max = 667px
6
6
  $device-tablet = 768px
7
- $device-laptop = 1024px
7
+ $device-laptop = 1180px
8
8
  $device-desktop = 1440px
9
9
  $device-2k = 2048px
10
10
  $device-4k = 2560px
@@ -106,10 +106,20 @@ floatable-float()
106
106
 
107
107
  hoverable-card()
108
108
  trans1 all
109
- @media (prefers-color-scheme: dark)
110
- &:hover
111
- box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
112
- @media (prefers-color-scheme: light)
109
+ onlight()
113
110
  box-shadow: $boxshadow-card
114
111
  &:hover
115
112
  floatable-float()
113
+ ondark()
114
+ &:hover
115
+ box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
116
+ if theme(light)
117
+ onlight()
118
+ else if theme(dark)
119
+ ondark()
120
+ else
121
+ @media (prefers-color-scheme: light)
122
+ onlight()
123
+ @media (prefers-color-scheme: dark)
124
+ ondark()
125
+