hexo-theme-stellar 1.16.2 → 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 (71) hide show
  1. package/_config.yml +10 -5
  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 +3 -3
  14. package/layout/_partial/{sidebar/widgets → widgets}/ghissues.ejs +2 -2
  15. package/layout/_partial/{sidebar/widgets → widgets}/ghrepo.ejs +2 -2
  16. package/layout/_partial/{sidebar/widgets → widgets}/ghuser.ejs +3 -3
  17. package/layout/_partial/{sidebar/widgets → widgets}/markdown.ejs +2 -2
  18. package/layout/_partial/{sidebar/widgets → widgets}/recent.ejs +5 -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/source/css/_common/base.styl +1 -1
  29. package/source/css/_common/highlight.styl +5 -5
  30. package/source/css/_common/span.styl +1 -0
  31. package/source/css/_layout/index.styl +1 -0
  32. package/source/css/_layout/list.styl +1 -1
  33. package/source/css/_layout/md.styl +12 -13
  34. package/source/css/_layout/pages/error.styl +2 -2
  35. package/source/css/_layout/partial/article-footer.styl +4 -4
  36. package/source/css/_layout/partial/paginator.styl +16 -5
  37. package/source/css/_layout/partial/related.styl +6 -14
  38. package/source/css/_layout/sidebar/footer.styl +1 -3
  39. package/source/css/_layout/sidebar/header.styl +112 -0
  40. package/source/css/_layout/sidebar/sidebar.styl +3 -115
  41. package/source/css/_layout/tag-plugins/checkbox.styl +1 -1
  42. package/source/css/_layout/tag-plugins/copy.styl +1 -1
  43. package/source/css/_layout/tag-plugins/emoji.styl +1 -1
  44. package/source/css/_layout/tag-plugins/frame.styl +5 -5
  45. package/source/css/_layout/tag-plugins/inline-labels.styl +1 -1
  46. package/source/css/_layout/tag-plugins/link.styl +6 -6
  47. package/source/css/_layout/tag-plugins/mark.styl +3 -4
  48. package/source/css/_layout/tag-plugins/navbar.styl +1 -1
  49. package/source/css/_layout/tag-plugins/note.styl +7 -7
  50. package/source/css/_layout/tag-plugins/poetry.styl +2 -2
  51. package/source/css/_layout/tag-plugins/quot.styl +7 -7
  52. package/source/css/_layout/tag-plugins/tabs.styl +1 -1
  53. package/source/css/_layout/tag-plugins/timeline.styl +3 -3
  54. package/source/css/_layout/widgets/ghrepo.styl +34 -0
  55. package/source/css/_layout/widgets/ghuser.styl +95 -0
  56. package/source/css/_layout/widgets/recent.styl +15 -0
  57. package/source/css/_layout/widgets/related.styl +8 -0
  58. package/source/css/_layout/widgets/search.styl +3 -0
  59. package/source/css/_layout/widgets/tagcloud.styl +8 -0
  60. package/source/css/_layout/widgets/timeline.styl +17 -0
  61. package/source/css/_layout/{sidebar → widgets}/toc_blog.styl +1 -1
  62. package/source/css/_layout/{sidebar → widgets}/toc_common.styl +7 -4
  63. package/source/css/_layout/{sidebar → widgets}/toc_wiki.styl +3 -7
  64. package/source/css/_layout/widgets/widgets.styl +60 -0
  65. package/source/css/_plugins/index.styl +4 -0
  66. package/source/css/_plugins/search/local-search.styl +89 -0
  67. package/source/js/main.js +41 -5
  68. package/source/js/search/local-search.js +161 -0
  69. package/source/css/_layout/sidebar/ghrepo.styl +0 -36
  70. package/source/css/_layout/sidebar/ghuser.styl +0 -98
  71. 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.2'
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 ...
@@ -51,7 +51,7 @@ article:
51
51
  category_color:
52
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
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,7 +69,7 @@ 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) => {
@@ -87,7 +87,7 @@ function layoutWidgets() {
87
87
  Object.assign(widget, w)
88
88
  }
89
89
  if (widget && widget.layout) {
90
- el += partial('widgets/' + widget.layout, {item: widget})
90
+ el += partial('../widgets/' + widget.layout, {item: widget})
91
91
  }
92
92
  });
93
93
  }
@@ -21,7 +21,7 @@ function layoutDiv() {
21
21
  if (item.labels) {
22
22
  item.api += '&labels=' + item.labels;
23
23
  }
24
- el += '<div class="widget-wrap" id="timeline">';
24
+ el += '<widget class="widget-wrapper timeline">';
25
25
  if (item.title) {
26
26
  el += '<div class="widget-header cap theme dis-select">';
27
27
  el += '<span class="name">' + item.title + '</span>';
@@ -37,7 +37,7 @@ function layoutDiv() {
37
37
  el += '>';
38
38
  el += '</div>';
39
39
  el += '</div>';
40
- el += '</div>';
40
+ el += '</widget>';
41
41
  return el;
42
42
  }
43
43
  %>
@@ -18,7 +18,7 @@ function layoutDiv() {
18
18
  return el;
19
19
  }
20
20
  // 布局
21
- el += '<div class="widget-wrap" id="repo-info">';
21
+ el += '<widget class="widget-wrapper ghrepo">';
22
22
  // body
23
23
  el += '<div class="widget-body">';
24
24
  el += '<div class="items stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/repos/' + repo + '">';
@@ -45,7 +45,7 @@ function layoutDiv() {
45
45
  el += '</a>';
46
46
  el += '</div>';
47
47
  el += '</div>';
48
- el += '</div>';
48
+ el += '</widget>';
49
49
  return el;
50
50
  }
51
51
  %>
@@ -22,7 +22,7 @@ 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
27
  el += '<div class="widget-body stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/users/' + item.username + '">';
28
28
  if (item.avatar) {
@@ -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
  %>
@@ -2,7 +2,7 @@
2
2
  function layoutDiv() {
3
3
  if (!item.content?.length) return ''
4
4
  var el = '';
5
- el += '<div class="widget-wrap" id="markdown">';
5
+ el += '<widget class="widget-wrapper markdown">';
6
6
  if (item.title?.length > 0) {
7
7
  el += '<div class="widget-header cap theme dis-select">';
8
8
  el += '<span class="name">' + item.title + '</span>';
@@ -11,7 +11,7 @@ function layoutDiv() {
11
11
  el += '<div class="widget-body fs14">';
12
12
  el += markdown(item.content);
13
13
  el += '</div>';
14
- el += '</div>';
14
+ el += '</widget>';
15
15
  return el;
16
16
  }
17
17
  %>
@@ -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>';
@@ -33,10 +33,9 @@ function layoutDiv() {
33
33
  el += '<span class="title">'
34
34
  if (post.layout == 'wiki') {
35
35
  let proj = theme.wiki.projects[post.wiki];
36
- if (proj && proj.name) {
37
- el += proj.name + ' / ';
38
- } else if (post.wiki) {
39
- el += post.wiki + ' / ';
36
+ let name = proj?.name || post?.wiki;
37
+ if (name) {
38
+ el += '<strong>' + name + '</strong>' + '<span class="dot"></span>';
40
39
  }
41
40
  }
42
41
  el += (post.title || post.seo_title || post.wiki) + '</span>';
@@ -44,7 +43,7 @@ function layoutDiv() {
44
43
  el += '';
45
44
  });
46
45
  el += '</div>';
47
- el += '</div>';
46
+ el += '</widget>';
48
47
  return el;
49
48
  }
50
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.2",
3
+ "version": "1.17.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -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
@@ -1,4 +1,4 @@
1
- article.md
1
+ .md-text
2
2
  max-width: 100%
3
3
  padding: 0 1rem
4
4
  margin-top: 1rem
@@ -8,7 +8,7 @@ article.md
8
8
  line-height: 1.7
9
9
  word-break: break-word
10
10
 
11
- article.md.excerpt
11
+ .md-text.excerpt
12
12
  p
13
13
  font-size: $fs-14
14
14
  margin: 1em 0
@@ -19,7 +19,7 @@ h1.article-title
19
19
  line-height: 1.2
20
20
  color: var(--text-p0)
21
21
 
22
- article.md.content
22
+ .md-text.content
23
23
  position: relative
24
24
  margin-bottom: 2rem
25
25
  display: flex
@@ -53,7 +53,7 @@ article.md.content
53
53
 
54
54
 
55
55
 
56
- article.md
56
+ .md-text
57
57
  ul:not(:last-child),
58
58
  ol:not(:last-child)
59
59
  padding-bottom: .5rem
@@ -65,7 +65,7 @@ article.md
65
65
  p,blockquote,.tag-plugin,ul,ol,.highlight,table
66
66
  *
67
67
  --gap-p: .5rem
68
- p,>ul:not(:last-child),>ol:not(:last-child)
68
+ p,ul,ol
69
69
  margin-top: 'calc(%s - 4px)' % var(--gap-p)
70
70
  margin-bottom: 'calc(%s - 4px)' % var(--gap-p)
71
71
  .tag-plugin,iframe
@@ -75,7 +75,7 @@ article.md
75
75
  display: block
76
76
 
77
77
  // titles
78
- article.md.content
78
+ .md-text.content
79
79
  a.headerlink:before
80
80
  opacity: 0
81
81
  content: '#'
@@ -101,35 +101,34 @@ article.md.content
101
101
  h5+h6
102
102
  margin-top: -0.5rem
103
103
 
104
- article.md p
104
+ .md-text p
105
105
  font-size: $fs-p
106
106
 
107
- article.md pre
107
+ .md-text pre
108
108
  -webkit-font-smoothing: auto
109
109
  -moz-osx-font-smoothing: auto
110
110
 
111
- article.md
111
+ .md-text
112
112
  .center
113
113
  align-self: center
114
114
 
115
115
  // div
116
- article.md>div
116
+ .md-text>div
117
117
  margin: var(--gap-p) 0
118
118
 
119
119
 
120
- article.md img
120
+ .md-text img
121
121
  border-radius: $border-image
122
122
  margin: auto
123
123
  display: block
124
124
 
125
- article.md
125
+ .md-text
126
126
  p:not([class]), li:not([class])
127
127
  a:not([class])
128
128
  position: relative
129
129
  padding: 2px 0
130
130
  text-decoration: none
131
131
  line-height: 1.2
132
- word-break: keep-all
133
132
  &:after
134
133
  content: ''
135
134
  position: absolute
@@ -1,4 +1,4 @@
1
- article.md.error-page
1
+ .md-text.error-page
2
2
  text-align: center
3
3
  margin-top: 2rem
4
4
  img#error
@@ -21,5 +21,5 @@ article.md.error-page
21
21
  border: 2px solid black
22
22
 
23
23
  @media screen and (max-width: $device-tablet)
24
- article.md.error-page
24
+ .md-text.error-page
25
25
  margin-top: 4rem