hexo-theme-stellar 1.16.1 → 1.17.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 (74) hide show
  1. package/_config.yml +15 -7
  2. package/_data/widgets.yml +4 -1
  3. package/languages/en.yml +5 -0
  4. package/languages/zh-CN.yml +5 -0
  5. package/languages/zh-TW.yml +5 -0
  6. package/layout/404.ejs +1 -1
  7. package/layout/_partial/cover/wiki_cover.ejs +1 -1
  8. package/layout/_partial/main/post_list/paginator.ejs +5 -9
  9. package/layout/_partial/main/post_list/post_card.ejs +1 -1
  10. package/layout/_partial/main/post_list/wiki_card.ejs +1 -1
  11. package/layout/_partial/plugins/comments/layout.ejs +1 -1
  12. package/layout/_partial/scripts/index.ejs +9 -0
  13. package/layout/_partial/sidebar/index.ejs +17 -7
  14. package/layout/_partial/{sidebar/widgets → widgets}/ghissues.ejs +5 -6
  15. package/layout/_partial/{sidebar/widgets → widgets}/ghrepo.ejs +5 -6
  16. package/layout/_partial/{sidebar/widgets → widgets}/ghuser.ejs +4 -4
  17. package/layout/_partial/widgets/markdown.ejs +18 -0
  18. package/layout/_partial/{sidebar/widgets → widgets}/recent.ejs +6 -6
  19. package/layout/_partial/{sidebar/widgets → widgets}/related.ejs +2 -2
  20. package/layout/_partial/widgets/search.ejs +31 -0
  21. package/layout/_partial/{sidebar/widgets → widgets}/tagcloud.ejs +2 -2
  22. package/layout/_partial/{sidebar/widgets → widgets}/timeline.ejs +2 -2
  23. package/layout/_partial/{sidebar/widgets → widgets}/toc.ejs +2 -2
  24. package/layout/page.ejs +1 -1
  25. package/layout/post.ejs +1 -1
  26. package/layout/wiki.ejs +1 -1
  27. package/package.json +1 -1
  28. package/scripts/tags/mark.js +3 -0
  29. package/source/css/_common/base.styl +1 -1
  30. package/source/css/_common/highlight.styl +5 -5
  31. package/source/css/_common/span.styl +1 -0
  32. package/source/css/_layout/index.styl +1 -0
  33. package/source/css/_layout/list.styl +1 -1
  34. package/source/css/_layout/md.styl +12 -13
  35. package/source/css/_layout/pages/error.styl +2 -2
  36. package/source/css/_layout/partial/article-footer.styl +4 -4
  37. package/source/css/_layout/partial/paginator.styl +16 -5
  38. package/source/css/_layout/partial/related.styl +6 -14
  39. package/source/css/_layout/sidebar/footer.styl +1 -3
  40. package/source/css/_layout/sidebar/header.styl +112 -0
  41. package/source/css/_layout/sidebar/sidebar.styl +3 -115
  42. package/source/css/_layout/tag-plugins/checkbox.styl +1 -1
  43. package/source/css/_layout/tag-plugins/common.styl +2 -2
  44. package/source/css/_layout/tag-plugins/copy.styl +1 -1
  45. package/source/css/_layout/tag-plugins/emoji.styl +1 -1
  46. package/source/css/_layout/tag-plugins/frame.styl +5 -5
  47. package/source/css/_layout/tag-plugins/inline-labels.styl +1 -1
  48. package/source/css/_layout/tag-plugins/link.styl +6 -6
  49. package/source/css/_layout/tag-plugins/mark.styl +3 -4
  50. package/source/css/_layout/tag-plugins/navbar.styl +1 -1
  51. package/source/css/_layout/tag-plugins/note.styl +7 -7
  52. package/source/css/_layout/tag-plugins/poetry.styl +2 -2
  53. package/source/css/_layout/tag-plugins/quot.styl +7 -7
  54. package/source/css/_layout/tag-plugins/tabs.styl +1 -1
  55. package/source/css/_layout/tag-plugins/timeline.styl +3 -3
  56. package/source/css/_layout/widgets/ghrepo.styl +34 -0
  57. package/source/css/_layout/widgets/ghuser.styl +95 -0
  58. package/source/css/_layout/widgets/recent.styl +15 -0
  59. package/source/css/_layout/widgets/related.styl +8 -0
  60. package/source/css/_layout/widgets/search.styl +3 -0
  61. package/source/css/_layout/widgets/tagcloud.styl +8 -0
  62. package/source/css/_layout/widgets/timeline.styl +17 -0
  63. package/source/css/_layout/{sidebar → widgets}/toc_blog.styl +1 -1
  64. package/source/css/_layout/{sidebar → widgets}/toc_common.styl +7 -4
  65. package/source/css/_layout/{sidebar → widgets}/toc_wiki.styl +3 -7
  66. package/source/css/_layout/widgets/widgets.styl +60 -0
  67. package/source/css/_plugins/index.styl +4 -0
  68. package/source/css/_plugins/search/local-search.styl +89 -0
  69. package/source/js/main.js +41 -5
  70. package/source/js/search/local-search.js +161 -0
  71. package/layout/_partial/sidebar/widgets/markdown.ejs +0 -18
  72. package/source/css/_layout/sidebar/ghrepo.styl +0 -36
  73. package/source/css/_layout/sidebar/ghuser.styl +0 -98
  74. package/source/css/_layout/sidebar/widgets.styl +0 -106
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.16.1'
3
+ version: '1.17.0'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  cdn_css: # Use cdn links instead of /css/main.css
@@ -25,10 +25,10 @@ sidebar:
25
25
  # about: '[关于](/about/)'
26
26
  # Sidebar widgets
27
27
  widgets:
28
- index: welcome, recent, timeline # for home/wiki/categories/tags/archives/404 pages
28
+ index: welcome, recent, search, timeline # for home/wiki/categories/tags/archives/404 pages
29
29
  page: welcome, toc # for pages using 'layout:page'
30
- post: toc, ghrepo, ghissues # for pages using 'layout:post'
31
- wiki: ghrepo, toc, ghissues, related # for pages using 'layout:wiki'
30
+ post: toc, ghrepo, search, ghissues # for pages using 'layout:post'
31
+ wiki: search, ghrepo, toc, ghissues, related # for pages using 'layout:wiki'
32
32
 
33
33
  ######## Index ########
34
34
  post-index: # 近期发布 分类 标签 归档 and ...
@@ -49,9 +49,9 @@ article:
49
49
  auto_excerpt: 200
50
50
  # 分类颜色
51
51
  category_color:
52
- '新闻稿': '#DA0F47'
52
+ '探索号': '#f44336'
53
53
  # 文章许可协议
54
- license: '本文采用[署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/)许可协议,转载请注明出处。'
54
+ license: '本文采用 [署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/) 许可协议,转载请注明出处。'
55
55
  # 分享
56
56
  share: # [wechat, weibo, email, link]
57
57
  # 相关文章,需要安装插件 (for layout: post)
@@ -61,6 +61,11 @@ article:
61
61
  max_count: 5
62
62
 
63
63
 
64
+ search:
65
+ service: local_search # hexo, todo...
66
+ local_search: # npm i hexo-generator-search
67
+
68
+
64
69
  ######## Comments ########
65
70
  comments:
66
71
  service: # beaudar, utterances, twikoo, waline
@@ -194,7 +199,7 @@ footer:
194
199
  tag_plugins:
195
200
  # {% note text %}
196
201
  note:
197
- default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple
202
+ default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
198
203
  # {% checkbox %}
199
204
  checkbox:
200
205
  interactive: false # enable interactive for user
@@ -219,6 +224,9 @@ tag_plugins:
219
224
  # {% timeline %}
220
225
  timeline:
221
226
  max-height: 80vh
227
+ # {% mark %}
228
+ mark:
229
+ default_color: dark # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
222
230
 
223
231
 
224
232
  ######## JS Plugins ########
package/_data/widgets.yml CHANGED
@@ -2,7 +2,10 @@
2
2
  # layout即组件布局,支持自定义的有:
3
3
  # - markdown: 渲染 md 文本
4
4
  #
5
-
5
+ search:
6
+ layout: search
7
+ filter: auto # auto or 'path'
8
+
6
9
  ghrepo:
7
10
  layout: ghrepo
8
11
  related:
package/languages/en.yml CHANGED
@@ -41,6 +41,11 @@ page:
41
41
  why: The address may be entered incorrectly or the address has been deleted.
42
42
  action: Back to Home
43
43
 
44
+ search:
45
+ search: Search
46
+ search_in: Search in %s
47
+ no_results: No Results!
48
+
44
49
  message:
45
50
  copied: Copied!
46
51
 
@@ -41,6 +41,11 @@ page:
41
41
  why: 可能是输入地址有误或该地址已被删除
42
42
  action: 返回主页
43
43
 
44
+ search:
45
+ search: 站内搜索
46
+ search_in: 在 %s 中搜索
47
+ no_results: 没有找到内容!
48
+
44
49
  message:
45
50
  copied: 复制成功
46
51
 
@@ -41,6 +41,11 @@ page:
41
41
  why: 可能是網址有誤或已經刪除
42
42
  action: 返回首頁
43
43
 
44
+ search:
45
+ search: 站內搜索
46
+ search_in: 在 %s 中搜索
47
+ no_results: 沒有找到內容!
48
+
44
49
  message:
45
50
  copied: 複製成功
46
51
 
package/layout/404.ejs CHANGED
@@ -5,7 +5,7 @@ page.comment_title = '';
5
5
  page.header = 'auto';
6
6
  page.robots = 'none';
7
7
  %>
8
- <article class='md error-page'>
8
+ <article class='md-text error-page'>
9
9
  <h1><img id='error' src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/404/1c830bfcd517d.svg' alt='404'></h1>
10
10
  <p class='what'>
11
11
  <strong>
@@ -19,7 +19,7 @@ function layoutWikiCover() {
19
19
  cover = ['logo', 'title', 'description'];
20
20
  }
21
21
  el += '<div class="l_cover wiki' + scrollreveal() + '">';
22
- el += '<article class="cover-wrap md">';
22
+ el += '<article class="cover-wrap md-text">';
23
23
 
24
24
  if (logo && logo.src && cover.includes('logo')) {
25
25
  el += '<div class="preview">';
@@ -1,13 +1,9 @@
1
1
  <% if (is_home() && page.total > 1) { %>
2
2
  <div class='paginator-wrap dis-select'>
3
- <a class='paginator prev<%- page.prev != 0 ? "" : " disable" %>' href='<%- url_for(page.prev_link) %>'>
4
- <img src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/f049bbd4e88ec.svg'/>
5
- </a>
6
- <div class='paginator current'>
7
- <%- page.current %><span class='sep'></span><%- page.total %>
8
- </div>
9
- <a class='paginator next<%- page.next != 0 ? "" : " disable" %>' href='<%- url_for(page.next_link) %>'>
10
- <img src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/064b95430caf4.svg'/>
11
- </a>
3
+ <%- paginator({
4
+ prev_text: '',
5
+ next_text: '',
6
+ force_prev_next:true
7
+ }) %>
12
8
  </div>
13
9
  <% } %>
@@ -11,7 +11,7 @@ if (poster) {
11
11
  }
12
12
  function div_default() {
13
13
  var el = '';
14
- el += '<article class="md">';
14
+ el += '<article class="md-text">';
15
15
 
16
16
  // 封面
17
17
  if (obj.image || theme.article.auto_cover) {
@@ -1,7 +1,7 @@
1
1
  <%
2
2
  function layoutDiv() {
3
3
  var el = '';
4
- el += '<article class="md">';
4
+ el += '<article class="md-text">';
5
5
  if (proj.logo && proj.logo.src) {
6
6
  el += '<div class="preview">';
7
7
  el += '<img src="' + proj.logo.src + '" alt="logo"';
@@ -31,7 +31,7 @@ if (cmt.service && page[cmt.service]) {
31
31
  page.cmt = cmt;
32
32
  %>
33
33
  <% if (loadComment) { %>
34
- <div class='related-wrap md reveal' id="comments">
34
+ <div class='related-wrap md-text reveal' id="comments">
35
35
  <div class='cmt-title cap theme'>
36
36
  <%- page.comment_title != undefined ? markdown(page.comment_title) : __('meta.comment_title') %>
37
37
  </div>
@@ -107,6 +107,15 @@
107
107
  jQuery: '<%- url_for(theme.plugins.jquery || "https://fastly.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js") %>'
108
108
  };
109
109
 
110
+ if ('<%- theme.search.service %>') {
111
+ stellar.search = {};
112
+ stellar.search.service = '<%- theme.search.service %>';
113
+ if (stellar.search.service == 'local_search') {
114
+ let service_obj = Object.assign({}, <%- JSON.stringify(config.search) %>);
115
+ stellar.search[stellar.search.service] = service_obj;
116
+ }
117
+ }
118
+
110
119
  // stellar js
111
120
  stellar.plugins.stellar = Object.assign(<%- JSON.stringify(theme.plugins.stellar) %>);
112
121
 
@@ -47,7 +47,7 @@ function layoutWidgets() {
47
47
  var el = '';
48
48
  el += '<div class="widgets">';
49
49
  if (page.layout == 'wiki' && proj && page.menu_id == 'wiki') {
50
- el += '<div class="widget-wrap logo-wrap wiki"><div class="widget-body">';
50
+ el += '<widget class="widget-wrapper logo-wrap wiki"><div class="widget-body">';
51
51
  // all products
52
52
  el += '<a style="filter: grayscale(100%)" class="wiki-home cap" href="' + url_for(config.wiki_dir) + '">';
53
53
  el += '<svg aria-hidden="true" viewBox="0 0 16 16" width="1rem" height="1rem" fill="currentColor"><path fill-rule="evenodd" d="M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"></path></svg>';
@@ -69,15 +69,25 @@ function layoutWidgets() {
69
69
  let sub = proj.subtitle;
70
70
  el += layoutTitle(main, url, sub);
71
71
  }
72
- el += '</div></div>';
72
+ el += '</div></widget>';
73
73
  }
74
74
  if (page.sidebar) {
75
75
  page.sidebar.forEach((w, i) => {
76
- if (w in theme.data.widgets) {
77
- let widget = theme.data.widgets[w];
78
- if (widget && widget.layout) {
79
- el += partial('widgets/' + widget.layout, {item: widget});
80
- }
76
+ let name = ''
77
+ let widget = {}
78
+ if (typeof w == 'string') {
79
+ name = w
80
+ } else if (typeof w == 'object' && w.override) {
81
+ name = w.override
82
+ }
83
+ if (name in theme.data.widgets) {
84
+ Object.assign(widget, theme.data.widgets[name])
85
+ }
86
+ if (typeof w == 'object' && w.override) {
87
+ Object.assign(widget, w)
88
+ }
89
+ if (widget && widget.layout) {
90
+ el += partial('../widgets/' + widget.layout, {item: widget})
81
91
  }
82
92
  });
83
93
  }
@@ -3,7 +3,9 @@ function layoutDiv() {
3
3
  var el = '';
4
4
  var repo;
5
5
  var branch = 'main';
6
- if (page.layout === 'wiki' && page.wiki) {
6
+ if (page.repo) {
7
+ repo = page.repo
8
+ } else if (page.layout === 'wiki' && page.wiki) {
7
9
  let proj = theme.wiki.projects[page.wiki];
8
10
  if (proj && proj.repo) {
9
11
  repo = proj.repo;
@@ -11,9 +13,6 @@ function layoutDiv() {
11
13
  branch = proj.branch;
12
14
  }
13
15
  }
14
- } else {
15
- // 其它的如果有设置 repo 也可以
16
- repo = page.repo;
17
16
  }
18
17
  if (repo == undefined) {
19
18
  return el;
@@ -22,7 +21,7 @@ function layoutDiv() {
22
21
  if (item.labels) {
23
22
  item.api += '&labels=' + item.labels;
24
23
  }
25
- el += '<div class="widget-wrap" id="timeline">';
24
+ el += '<widget class="widget-wrapper timeline">';
26
25
  if (item.title) {
27
26
  el += '<div class="widget-header cap theme dis-select">';
28
27
  el += '<span class="name">' + item.title + '</span>';
@@ -38,7 +37,7 @@ function layoutDiv() {
38
37
  el += '>';
39
38
  el += '</div>';
40
39
  el += '</div>';
41
- el += '</div>';
40
+ el += '</widget>';
42
41
  return el;
43
42
  }
44
43
  %>
@@ -3,7 +3,9 @@ function layoutDiv() {
3
3
  var el = '';
4
4
  var repo;
5
5
  var branch = 'main';
6
- if (page.layout === 'wiki' && page.wiki) {
6
+ if (page.repo) {
7
+ repo = page.repo
8
+ } else if (page.layout === 'wiki' && page.wiki) {
7
9
  let proj = theme.wiki.projects[page.wiki];
8
10
  if (proj && proj.repo) {
9
11
  repo = proj.repo;
@@ -11,15 +13,12 @@ function layoutDiv() {
11
13
  branch = proj.branch;
12
14
  }
13
15
  }
14
- } else {
15
- // 其它的如果有设置 repo 也可以
16
- repo = page.repo;
17
16
  }
18
17
  if (repo == undefined) {
19
18
  return el;
20
19
  }
21
20
  // 布局
22
- el += '<div class="widget-wrap" id="repo-info">';
21
+ el += '<widget class="widget-wrapper ghrepo">';
23
22
  // body
24
23
  el += '<div class="widget-body">';
25
24
  el += '<div class="items stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/repos/' + repo + '">';
@@ -46,7 +45,7 @@ function layoutDiv() {
46
45
  el += '</a>';
47
46
  el += '</div>';
48
47
  el += '</div>';
49
- el += '</div>';
48
+ el += '</widget>';
50
49
  return el;
51
50
  }
52
51
  %>
@@ -22,9 +22,9 @@ function layoutDiv() {
22
22
  return el;
23
23
  }
24
24
 
25
- el += '<div class="widget-wrap" id="github-user">';
25
+ el += '<widget class="widget-wrapper ghuser">';
26
26
  // body
27
- el += '<div class="widget-body stellar-ghinfo-api" api="' + item.api + '/users/' + item.username + '">';
27
+ el += '<div class="widget-body stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/users/' + item.username + '">';
28
28
  if (item.avatar) {
29
29
  el += '<div class="avatar" ><img no-lazy type="img" id="avatar_url" src="' + config.avatar + '"></div>';
30
30
  }
@@ -47,10 +47,10 @@ function layoutDiv() {
47
47
  el += '</a>';
48
48
  // menu
49
49
  if (item.menu) {
50
- el += partial('../menu', {where: 'sidebar'});
50
+ el += partial('../sidebar/menu', {where: 'sidebar'});
51
51
  }
52
52
  el += '</div>';
53
- el += '</div>';
53
+ el += '</widget>';
54
54
  return el;
55
55
  }
56
56
  %>
@@ -0,0 +1,18 @@
1
+ <%
2
+ function layoutDiv() {
3
+ if (!item.content?.length) return ''
4
+ var el = '';
5
+ el += '<widget class="widget-wrapper markdown">';
6
+ if (item.title?.length > 0) {
7
+ el += '<div class="widget-header cap theme dis-select">';
8
+ el += '<span class="name">' + item.title + '</span>';
9
+ el += '</div>';
10
+ }
11
+ el += '<div class="widget-body fs14">';
12
+ el += markdown(item.content);
13
+ el += '</div>';
14
+ el += '</widget>';
15
+ return el;
16
+ }
17
+ %>
18
+ <%- layoutDiv() %>
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  function layoutDiv() {
3
- var el = '<div class="widget-wrap" id="recent">';
3
+ var el = '<widget class="widget-wrapper recent">';
4
4
  // header
5
5
  el += '<div class="widget-header cap theme dis-select">';
6
6
  el += '<span class="name">' + __("meta.recent_update") + '</span>';
@@ -28,14 +28,14 @@ function layoutDiv() {
28
28
  el += '<div class="widget-body related-posts fs14">';
29
29
  arr.length = item.limit
30
30
  arr.forEach(post => {
31
+ if (!post) { return }
31
32
  el += '<a class="item title" href="' + url_for(post.link || post.path) + '">';
32
33
  el += '<span class="title">'
33
34
  if (post.layout == 'wiki') {
34
35
  let proj = theme.wiki.projects[post.wiki];
35
- if (proj && proj.name) {
36
- el += proj.name + ' / ';
37
- } else if (post.wiki) {
38
- el += post.wiki + ' / ';
36
+ let name = proj?.name || post?.wiki;
37
+ if (name) {
38
+ el += '<strong>' + name + '</strong>' + '<span class="dot"></span>';
39
39
  }
40
40
  }
41
41
  el += (post.title || post.seo_title || post.wiki) + '</span>';
@@ -43,7 +43,7 @@ function layoutDiv() {
43
43
  el += '';
44
44
  });
45
45
  el += '</div>';
46
- el += '</div>';
46
+ el += '</widget>';
47
47
  return el;
48
48
  }
49
49
  %>
@@ -15,7 +15,7 @@ function layoutDiv() {
15
15
  }
16
16
  var el = '';
17
17
  if (related.length > 0) {
18
- el += '<div class="widget-wrap" id="related">';
18
+ el += '<widget class="widget-wrapper related">';
19
19
  el += '<div class="widget-header cap theme dis-select">';
20
20
  var title = __('btn.wiki');
21
21
  if (proj.tags && proj.tags[0]) {
@@ -34,7 +34,7 @@ function layoutDiv() {
34
34
  el += '</a>';
35
35
  });
36
36
  el += '</div>';
37
- el += '</div>';
37
+ el += '</widget>';
38
38
  }
39
39
  return el;
40
40
  }
@@ -0,0 +1,31 @@
1
+ <%
2
+ function layoutDiv() {
3
+ var el = '<widget class="widget-wrapper search">'
4
+ el += '<div class="widget-body">'
5
+ el += '<div class="search-wrapper" id="search">'
6
+ el += '<form class="search-form">'
7
+ var filter = ''
8
+ if (item.filter == 'auto' && page.layout == 'wiki') {
9
+ let matches = page.path.match(/(.*?)\/(.*?)\//i)
10
+ if (matches?.length > 0) {
11
+ filter = matches[0]
12
+ }
13
+ }
14
+ el += '<input type="text" class="search-input" id="search-input"'
15
+ if (filter.length > 0) {
16
+ filter = '/' + filter
17
+ el += ' data-filter="' + filter + '"'
18
+ el += ' placeholder="' + (item.placeholder || __('search.search_in', filter)) + '">'
19
+ } else {
20
+ el += ' placeholder="' + (item.placeholder || __('search.search')) + '">'
21
+ }
22
+ el += '</form>'
23
+ el += '<div id="search-result"></div>'
24
+ el += '<div class="search-no-result">' + __('search.no_results') + '</div>'
25
+ el += '</div>'
26
+ el += '</div>'
27
+ el += '</widget>'
28
+ return el
29
+ }
30
+ %>
31
+ <%- layoutDiv() %>
@@ -8,7 +8,7 @@ function layoutDiv() {
8
8
  delete opts['title'];
9
9
  delete opts['layout'];
10
10
  opts.class = 'tag ';
11
- el += '<div class="widget-wrap" id="tagcloud">';
11
+ el += '<widget class="widget-wrapper tagcloud">';
12
12
  if (item.title) {
13
13
  el += '<div class="widget-header cap theme dis-select">';
14
14
  el += '<span class="name">' + item.title + '</span>';
@@ -17,7 +17,7 @@ function layoutDiv() {
17
17
  el += '<div class="widget-body fs14">';
18
18
  el += tagcloud(site.tags, opts);
19
19
  el += '</div>';
20
- el += '</div>';
20
+ el += '</widget>';
21
21
  return el;
22
22
  }
23
23
  %>
@@ -4,7 +4,7 @@ function layoutDiv() {
4
4
  if (item.api == undefined) {
5
5
  return el;
6
6
  }
7
- el += '<div class="widget-wrap" id="timeline">';
7
+ el += '<widget class="widget-wrapper timeline">';
8
8
  if (item.title) {
9
9
  el += '<div class="widget-header cap theme dis-select">';
10
10
  el += '<span class="name">' + item.title + '</span>';
@@ -20,7 +20,7 @@ function layoutDiv() {
20
20
  el += '>';
21
21
  el += '</div>';
22
22
  el += '</div>';
23
- el += '</div>';
23
+ el += '</widget>';
24
24
  return el;
25
25
  }
26
26
  %>
@@ -63,7 +63,7 @@ function layoutDiv(fallback) {
63
63
 
64
64
  var el = '';
65
65
  if (type.length > 0) {
66
- el += '<div class="widget-wrap ' + type + '" id="toc">';
66
+ el += '<widget class="widget-wrapper toc ' + type + '" id="toc">';
67
67
  if (page.layout !== 'wiki') {
68
68
  // post 布局
69
69
  el += layoutTocHeader(page.toc_title);
@@ -90,7 +90,7 @@ function layoutDiv(fallback) {
90
90
  el += '</div>';
91
91
  }
92
92
  }
93
- el += '</div>';
93
+ el += '</widget>';
94
94
  } else if (item.fallback) {
95
95
  el += partial(item.fallback, {item: theme.data.widgets[item.fallback]});
96
96
  }
package/layout/page.ejs CHANGED
@@ -15,7 +15,7 @@ function layoutDiv() {
15
15
  if (page.h1 || page.title || (page.content && page.content.length > 0)) {
16
16
  el += partial('_partial/main/navbar/breadcrumb');
17
17
  }
18
- el += '<article class="content md ' + page.layout + (page.indent ? ' indent' : '') + scrollreveal() + '">';
18
+ el += '<article class="md-text content ' + page.layout + (page.indent ? ' indent' : '') + scrollreveal() + '">';
19
19
  el += layoutTitle();
20
20
  if (page.content && page.content.length > 0) {
21
21
  el += page.content;
package/layout/post.ejs CHANGED
@@ -23,7 +23,7 @@ if (theme.plugins.heti && theme.plugins.heti.enable) {
23
23
  <%- partial('mathjax') %>
24
24
  <% } %>
25
25
  <%- partial('_partial/main/navbar/breadcrumb') %>
26
- <article class='content<%- heti %> md <%- post.layout %><%- post.indent ? ' indent' : '' %><%- scrollreveal() %>'>
26
+ <article class='md-text content<%- heti %> <%- post.layout %><%- post.indent ? ' indent' : '' %><%- scrollreveal() %>'>
27
27
  <%- layoutTitle() %>
28
28
  <%- post.content %>
29
29
  <%- partial('_partial/main/article/article_footer') %>
package/layout/wiki.ejs CHANGED
@@ -30,7 +30,7 @@ function layoutTitle() {
30
30
  }
31
31
  %>
32
32
  <%- partial('_partial/main/navbar/breadcrumb') %>
33
- <article class='content md <%- page.layout %><%- scrollreveal() %>'>
33
+ <article class='md-text content <%- page.layout %><%- scrollreveal() %>'>
34
34
  <%- layoutTitle() %>
35
35
  <%- page.content %>
36
36
  <%- partial('_partial/main/article/article_footer') %>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.16.1",
3
+ "version": "1.17.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -10,6 +10,9 @@
10
10
 
11
11
  hexo.extend.tag.register('mark', function(args) {
12
12
  args = hexo.args.map(args, ['color'], ['text']);
13
+ if (args.color == null) {
14
+ args.color = hexo.theme.config.tag_plugins.mark.default_color
15
+ }
13
16
  var el = '';
14
17
  el += '<mark class="tag-plugin mark"';
15
18
  el += ' ' + hexo.args.joinTags(args, ['color']).join(' ');
@@ -12,7 +12,7 @@ a
12
12
  &:hover
13
13
  color: $color-hover
14
14
 
15
- .md p:not([class])
15
+ .md-text p:not([class])
16
16
  text-align: convert(hexo-config('style.text-align'))
17
17
 
18
18
  hr
@@ -10,7 +10,7 @@ p>code:not([class]),li>code:not([class])
10
10
  border-radius: 4px
11
11
  color: var(--text-code)
12
12
 
13
- article.md .highlight, pre:not([class]):has(>code)
13
+ .md-text .highlight, pre:not([class]):has(>code)
14
14
  margin: var(--gap-p) 0
15
15
  border-radius: $border-block
16
16
  overflow: hidden
@@ -22,7 +22,7 @@ article.md .highlight, pre:not([class]):has(>code)
22
22
  @media screen and (min-width: $device-mobile)
23
23
  min-width: 180px
24
24
 
25
- article.md .highlight
25
+ .md-text .highlight
26
26
  position: relative
27
27
  overflow: auto
28
28
  display: block
@@ -75,7 +75,7 @@ article.md .highlight
75
75
  .gutter+.code pre
76
76
  padding-left: 0.25em
77
77
 
78
- article.md .gist
78
+ .md-text .gist
79
79
  .gist-file
80
80
  border: 1px solid var(--block-border)
81
81
  border-radius: $border-block
@@ -96,7 +96,7 @@ table:not([class])
96
96
  border-collapse: collapse
97
97
 
98
98
 
99
- article.md pre
99
+ .md-text pre
100
100
  >.caption
101
101
  color: var(--text-p3)
102
102
  >.hljs
@@ -106,7 +106,7 @@ article.md pre
106
106
  line-height: 1.5
107
107
  box-sizing: border-box
108
108
 
109
- article.md .highlight
109
+ .md-text .highlight
110
110
  .code
111
111
  vertical-align: top
112
112
  &:before
@@ -3,6 +3,7 @@ span.dot,span.sep
3
3
  margin: 0 .25em
4
4
  span.dot:before
5
5
  content: '·'
6
+ font-weight: 900
6
7
  span.sep:before
7
8
  content: '/'
8
9
  padding-left: 2px
@@ -1,4 +1,5 @@
1
1
  @import 'partial/*'
2
2
  @import 'tag-plugins/*'
3
3
  @import 'sidebar/*'
4
+ @import 'widgets/*'
4
5
  @import 'pages/*'
@@ -62,7 +62,7 @@
62
62
 
63
63
 
64
64
  // common article
65
- .post-list article.md
65
+ .post-list .md-text
66
66
  padding: 1rem
67
67
  @media screen and (max-width: $device-mobile)
68
68
  padding: 0.5rem 1rem