hexo-theme-stellar 1.11.0 → 1.12.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 (62) hide show
  1. package/_config.yml +15 -12
  2. package/_data/widgets.yml +30 -6
  3. package/languages/zh-CN.yml +4 -4
  4. package/languages/zh-TW.yml +4 -4
  5. package/layout/_partial/main/article/read_next.ejs +16 -17
  6. package/layout/_partial/main/navbar/breadcrumb.ejs +1 -1
  7. package/layout/_partial/main/post_list/post_card.ejs +21 -15
  8. package/layout/_partial/main/post_list/wiki_card.ejs +1 -1
  9. package/layout/_partial/sidebar/header.ejs +2 -26
  10. package/layout/_partial/sidebar/logo.ejs +2 -2
  11. package/layout/_partial/sidebar/menu.ejs +27 -0
  12. package/layout/_partial/sidebar/widgets/ghissues.ejs +46 -0
  13. package/layout/_partial/sidebar/widgets/ghrepo.ejs +3 -3
  14. package/layout/_partial/sidebar/widgets/ghuser.ejs +4 -0
  15. package/layout/_partial/sidebar/widgets/markdown.ejs +1 -1
  16. package/layout/_partial/sidebar/widgets/recent.ejs +8 -11
  17. package/layout/_partial/sidebar/widgets/{wiki_more.ejs → related.ejs} +7 -7
  18. package/layout/_partial/sidebar/widgets/tagcloud.ejs +24 -0
  19. package/layout/_partial/sidebar/widgets/timeline.ejs +27 -0
  20. package/layout/_partial/sidebar/widgets/toc.ejs +1 -5
  21. package/layout/index.ejs +1 -1
  22. package/package.json +1 -1
  23. package/scripts/events/lib/doc_tree.js +3 -0
  24. package/scripts/helpers/related_posts.js +11 -39
  25. package/scripts/tags/about.js +10 -7
  26. package/scripts/tags/{grid.js → border.js} +4 -4
  27. package/scripts/tags/link.js +11 -9
  28. package/scripts/tags/navbar.js +1 -1
  29. package/scripts/tags/sites.js +1 -1
  30. package/scripts/tags/split.js +51 -0
  31. package/source/css/_common/base.styl +2 -2
  32. package/source/css/_common/blur.styl +3 -0
  33. package/source/css/_common/device.styl +2 -0
  34. package/source/css/_common/highlight.styl +1 -1
  35. package/source/css/_common/loading.styl +16 -3
  36. package/source/css/_common/title.styl +0 -13
  37. package/source/css/_custom.styl +4 -4
  38. package/source/css/_layout/list.styl +40 -9
  39. package/source/css/_layout/md.styl +1 -1
  40. package/source/css/_layout/partial/related.styl +62 -93
  41. package/source/css/_layout/sidebar/footer.styl +4 -2
  42. package/source/css/_layout/sidebar/ghrepo.styl +11 -5
  43. package/source/css/_layout/sidebar/ghuser.styl +19 -1
  44. package/source/css/_layout/sidebar/sidebar.styl +4 -90
  45. package/source/css/_layout/sidebar/toc_common.styl +5 -3
  46. package/source/css/_layout/sidebar/widgets.styl +104 -0
  47. package/source/css/_layout/tag-plugins/about.styl +21 -18
  48. package/source/css/_layout/tag-plugins/common.styl +36 -31
  49. package/source/css/_layout/tag-plugins/link.styl +41 -27
  50. package/source/css/_layout/tag-plugins/navbar.styl +10 -4
  51. package/source/css/_layout/tag-plugins/quot.styl +1 -1
  52. package/source/css/_layout/tag-plugins/split.styl +28 -0
  53. package/source/css/_layout/tag-plugins/timeline.styl +18 -9
  54. package/source/css/_plugins/comments/twikoo.styl +11 -5
  55. package/source/css/_plugins/comments/valine.styl +4 -0
  56. package/source/css/_plugins/comments/waline.styl +1 -1
  57. package/source/js/main.js +14 -8
  58. package/source/js/plugins/friends.js +3 -2
  59. package/source/js/plugins/ghinfo.js +14 -2
  60. package/source/js/plugins/linkcard.js +124 -0
  61. package/source/js/plugins/sites.js +4 -3
  62. package/source/js/plugins/timeline.js +11 -6
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.11.0'
3
+ version: '1.12.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] # for home/wiki/categories/tags/archives/404 pages
28
+ index: [welcome, recent, timeline] # for home/wiki/categories/tags/archives/404 pages
29
29
  page: [welcome, toc] # for pages using 'layout:page'
30
- post: [toc, ghrepo] # for pages using 'layout:post'
31
- wiki: [ghrepo, toc, wiki_more] # for pages using 'layout:wiki'
30
+ post: [toc, ghrepo, ghissues] # for pages using 'layout:post'
31
+ wiki: [toc, ghrepo, ghissues, related] # for pages using 'layout:wiki'
32
32
 
33
33
 
34
34
  ######## Main ########
@@ -55,7 +55,6 @@ article:
55
55
  related_posts:
56
56
  enable: false
57
57
  max_count: 5
58
- auto_cover: true # 如果没有封面就根据 tags 作为关键词搜索封面,开了此项将不会自动从文章中提取首张图片作为封面了。
59
58
 
60
59
 
61
60
  ######## Comments ########
@@ -220,10 +219,10 @@ tag_plugins:
220
219
  # {% quot %}
221
220
  quot:
222
221
  default: # 可以自行配置多种图标方案
223
- prefix: https://s2.loli.net/2022/01/04/vsTB5pGrIHfPxSj.png
224
- suffix: https://s2.loli.net/2022/01/04/NORdtjlAhifZSns.png
222
+ prefix: https://bu.dusays.com/2022/10/24/63567d3e092ff.png
223
+ suffix: https://bu.dusays.com/2022/10/24/63567d3e0ab55.png
225
224
  hashtag:
226
- prefix: https://s2.loli.net/2022/01/04/UvHcsa73jQPnobq.png
225
+ prefix: https://bu.dusays.com/2022/10/24/63567d3e07da3.png
227
226
  # {% emoji %}
228
227
  emoji:
229
228
  default: https://fastly.jsdelivr.net/gh/cdn-x/emoji/qq/%s.gif
@@ -251,7 +250,7 @@ plugins:
251
250
  friends: /js/plugins/friends.js
252
251
  ghinfo: /js/plugins/ghinfo.js
253
252
  timeline: /js/plugins/timeline.js
254
-
253
+ linkcard: /js/plugins/linkcard.js
255
254
 
256
255
  marked: https://cdn.bootcdn.net/ajax/libs/marked/4.0.18/marked.min.js
257
256
 
@@ -327,9 +326,10 @@ style:
327
326
  smooth_scroll: true # true / false
328
327
  font-size: 16px
329
328
  font-family:
330
- logo: system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
331
- body: system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
332
- code: Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif
329
+ logo: 'system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif'
330
+ body: 'system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif'
331
+ code: 'Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif'
332
+ text-align: left
333
333
  color:
334
334
  common:
335
335
  theme: '#1BCDFC' # 主题色
@@ -358,6 +358,9 @@ style:
358
358
  codeblock:
359
359
  scrollbar: 4px
360
360
  highlightjs_theme: https://fastly.jsdelivr.net/gh/highlightjs/cdn-release@11.5.0/build/styles/atom-one-dark.min.css
361
+ loading:
362
+ loading: 正在加载
363
+ error: 加载失败,请稍后重试。
361
364
 
362
365
  default:
363
366
  avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg
package/_data/widgets.yml CHANGED
@@ -3,13 +3,17 @@
3
3
  # - markdown: 渲染 md 文本
4
4
  #
5
5
 
6
- # ---- 内置组件,暂时不支持覆盖 ----
7
6
  ghrepo:
8
7
  layout: ghrepo
9
- wiki_more:
10
- layout: wiki_more
8
+ related:
9
+ layout: related
10
+
11
+ ghissues:
12
+ layout: ghissues
13
+ title: # Recent Issues
14
+ limit: 3 # 显示的issues最大数量
15
+ labels: # 过滤只显示具有某些标签的issues
11
16
 
12
- # ---- 默认组件,可以覆盖自定义配置 ----
13
17
  # 将其覆盖设置为空,可删除一个默认组件,例如 welcome:
14
18
  # Recent update
15
19
  recent:
@@ -28,8 +32,22 @@ ghuser:
28
32
  layout: ghuser
29
33
  api: https://api.github.com
30
34
  username: github # your github login username
31
- avatar: true # true / false
35
+ avatar: true # show avatar or not
36
+ menu: true # show menu or not
32
37
 
38
+ tagcloud:
39
+ layout: tagcloud
40
+ title: 标签云
41
+ # 标签云配置
42
+ min_font: 12
43
+ max_font: 24
44
+ amount: 100
45
+ orderby: name
46
+ order: 1 # 1, sac 升序;-1, desc 降序
47
+ color: false # 使用颜色
48
+ start_color: # 开始的颜色。您可使用十六进位值(#b700ff),rgba(rgba(183, 0, 255, 1)),hsla(hsla(283, 100%, 50%, 1))或 颜色关键字。此变量仅在 color 参数开启时才有用。
49
+ end_color: # 结束的颜色。您可使用十六进位值(#b700ff),rgba(rgba(183, 0, 255, 1)),hsla(hsla(283, 100%, 50%, 1))或 颜色关键字。此变量仅在 color 参数开启时才有用。
50
+ show_count: false # 显示每个标签的文章总数
33
51
 
34
52
  welcome:
35
53
  layout: markdown
@@ -43,4 +61,10 @@ welcome:
43
61
  **第二步**
44
62
  创建 `blog/source/_data/widgets.yml` 文件,此文件中填写需要自定义的侧边栏组件,例如 `welcome` 组件。
45
63
  <br>
46
- 如果有任何疑问,请先查阅[文档](https://xaoxuu.com/wiki/stellar/),如果文档中没有提供,请提 [issue](https://github.com/xaoxuu/hexo-theme-stellar/issues/) 向开发中询问。
64
+ 如果有任何疑问,请先查阅[文档](https://xaoxuu.com/wiki/stellar/),如果文档中没有提供,请提 [issue](https://github.com/xaoxuu/hexo-theme-stellar/issues/) 向开发中询问。
65
+
66
+ timeline:
67
+ layout: timeline
68
+ title: 近期动态
69
+ api: https://api.github.com/repos/xaoxuu/hexo-theme-stellar/issues
70
+ user:
@@ -15,10 +15,10 @@ meta:
15
15
  recent_update: 最近更新
16
16
  toc: 本文目录
17
17
  read_next: 接下来阅读
18
- prev: 上一篇
19
- next: 下一篇
20
- older: 较早
21
- newer: 较新
18
+ prev: 回顾上一篇
19
+ next: 接下来阅读
20
+ older: 较早文章
21
+ newer: 较新文章
22
22
  references: 参考资料
23
23
  related_posts: 您可能感兴趣的文章
24
24
  comment_title: 快来参与讨论吧
@@ -15,10 +15,10 @@ meta:
15
15
  recent_update: 最近更新
16
16
  toc: 本文目錄
17
17
  read_next: 接下來閱讀
18
- prev: 上一篇
19
- next: 下一篇
20
- older: 較早
21
- newer: 較新
18
+ prev: 回顧上一篇
19
+ next: 接下來閱讀
20
+ older: 較早文章
21
+ newer: 較新文章
22
22
  references: 參考資料
23
23
  related_posts: 您可能感興趣的文章
24
24
  comment_title: 參與討論
@@ -25,31 +25,30 @@ function layoutDiv() {
25
25
  }
26
26
  });
27
27
  }
28
- if (next == undefined) {
29
- // 项目的最后一篇文档
30
- return '<br>';
31
- }
32
28
  }
33
29
  let el = '';
34
30
  if (prev || next) {
35
31
  el += '<div class="related-wrap reveal" id="read-next">';
36
- el += '<section class="header cap theme">';
37
- el += '<span>' + title + '</span>';
38
- el += '</section>';
39
- el += '<section class="body fs14">';
40
- if (next) {
41
- el += '<a id="next" href="' + url_for(next.path) + '">';
42
- el += next.title || next.seo_title || next.wiki;
43
- el += '<span class="note">' + title_next + '</span>';
44
- el += '</a>';
45
- }
46
- el += '<div class="line"></div>';
32
+ el += '<section class="body">';
33
+ // prev
34
+ el += '<div class="item" id="prev">';
47
35
  if (prev) {
48
- el += '<a id="prev" href="' + url_for(prev.path) + '">';
36
+ el += '<div class="note">' + title_prev + '</div>';
37
+ el += '<a href="' + url_for(prev.path) + '">';
49
38
  el += prev.title || prev.seo_title || prev.wiki;
50
- el += '<span class="note">' + title_prev + '</span>';
51
39
  el += '</a>';
52
40
  }
41
+ el += '</div>';
42
+ // next
43
+ el += '<div class="item" id="next">';
44
+ if (next) {
45
+ el += '<div class="note">' + title_next + '</div>';
46
+ el += '<a href="' + url_for(next.path) + '">';
47
+ el += next.title || next.seo_title || next.wiki;
48
+ el += '</a>';
49
+ }
50
+ el += '</div>';
51
+
53
52
  el += '</section>';
54
53
  el += '</div>';
55
54
  }
@@ -62,7 +62,7 @@ function layoutDiv() {
62
62
  let url_proj = url_for(proj.homepage.path);
63
63
  if (nodes.includes(url_proj) === false) {
64
64
  el += '<span class="sep"></span>';
65
- el += '<a class="cap breadcrumb" id="proj" href="' + url_proj + '">' + proj.title + '</a>';
65
+ el += '<a class="cap breadcrumb" id="proj" href="' + url_proj + '">' + (proj.name || proj.title) + '</a>';
66
66
  }
67
67
  el += '</div>';
68
68
  // 更新日期
@@ -1,16 +1,22 @@
1
1
  <%
2
+ const obj = {
3
+ image: post['cover'],
4
+ title: post['cover-title'],
5
+ cat: post['cover-cat'],
6
+ subtitle: post['cover-subtitle']
7
+ };
2
8
  function div_default() {
3
9
  var el = '';
4
10
  el += '<article class="md">';
5
11
 
6
12
  // 封面
7
- if (post.cover || theme.article.auto_cover) {
13
+ if (obj.image || theme.article.auto_cover) {
8
14
  var cover_url;
9
- if (post.cover != undefined) {
10
- if (post.cover.includes('/')) {
11
- cover_url = post.cover;
15
+ if (obj.image != undefined) {
16
+ if (obj.image.includes('/')) {
17
+ cover_url = obj.image;
12
18
  } else {
13
- cover_url = 'https://source.unsplash.com/1280x640/?' + post.cover;
19
+ cover_url = 'https://source.unsplash.com/1280x640/?' + obj.image;
14
20
  }
15
21
  } else {
16
22
  // 自动以 tags 作为关键词搜索封面
@@ -89,22 +95,22 @@ function div_default() {
89
95
  function div_photo() {
90
96
  var el = '';
91
97
  el += '<div class="cover">';
92
- el += '<img src="' + post.cover + '"/>';
93
- if (post.cover_info) {
98
+ el += '<img src="' + obj.image + '"/>';
99
+ if (obj.title || obj.cat || obj.subtitle) {
94
100
  el += '<div class="cover-info"';
95
- if (post.cover_info.meta) {
101
+ if (obj.cat) {
96
102
  el += 'position="top">';
97
103
  } else {
98
104
  el += 'position="bottom">';
99
105
  }
100
- if (post.cover_info.meta) {
101
- el += '<div class="cap">' + post.cover_info.meta + '</div>';
106
+ if (obj.cat) {
107
+ el += '<div class="cap">' + obj.cat + '</div>';
102
108
  }
103
- if (post.cover_info.title) {
104
- el += '<div class="title">' + post.cover_info.title + '</div>';
109
+ if (obj.title) {
110
+ el += '<div class="title">' + obj.title + '</div>';
105
111
  }
106
- if (post.cover_info.subtitle) {
107
- el += '<div class="cap">' + post.cover_info.subtitle + '</div>';
112
+ if (obj.subtitle) {
113
+ el += '<div class="cap">' + obj.subtitle + '</div>';
108
114
  }
109
115
  el += '</div>';
110
116
 
@@ -113,7 +119,7 @@ function div_photo() {
113
119
  return el;
114
120
  }
115
121
  function div() {
116
- if (post.cover && post.cover.length > 0 && post.cover_info != undefined) {
122
+ if (obj.image && obj.image.length > 0 && obj.title != undefined) {
117
123
  return div_photo();
118
124
  }
119
125
  return div_default();
@@ -16,7 +16,7 @@ function layoutDiv() {
16
16
  let tag = proj.tags[0];
17
17
  el += '<div class="cap breadcrumb"' + category_color(tag) + '>' + tag + '</div>';
18
18
  }
19
- el += '<h2 class="post-title">' + (proj.wiki || proj.title || proj.seo_title) + '</h2>';
19
+ el += '<h2 class="post-title">' + (proj.title || proj.name || proj.seo_title) + '</h2>';
20
20
  if (proj.description) {
21
21
  el += '<p>' + proj.description + '</p>';
22
22
  }
@@ -1,27 +1,4 @@
1
1
  <%
2
- function layoutMenu() {
3
- var el = '';
4
- el += '<nav class="menu dis-select';
5
- if (where == 'main') {
6
- el += ' mobile-hidden';
7
- }
8
- el += '">';
9
- for (let id of Object.keys(theme.sidebar.menu)) {
10
- let item = theme.sidebar.menu[id];
11
- if (item == undefined || item.length == 0) {
12
- continue;
13
- }
14
- el += '<a class="nav-item';
15
- if (id == page.menu_id) {
16
- el += ' active';
17
- }
18
- el += '" href="' + url_for(md_link(item)) + '">';
19
- el += __(md_text(item));
20
- el += '</a>';
21
- }
22
- el += '</nav>';
23
- return el;
24
- }
25
2
  function layoutDiv() {
26
3
  var el = '';
27
4
  el += '<header class="header';
@@ -33,13 +10,12 @@ function layoutDiv() {
33
10
  if (where != 'main') {
34
11
  if (page.layout === 'wiki' && page.wiki) {
35
12
  if (page.menu_id !== 'wiki') {
36
- el += layoutMenu();
13
+ el += partial('menu', {where: where});
37
14
  }
38
15
  } else {
39
- el += layoutMenu();
16
+ el += partial('menu', {where: where});
40
17
  }
41
18
  }
42
-
43
19
  el += '</header>';
44
20
  return el;
45
21
  }
@@ -21,7 +21,7 @@ function layoutTitle(main, url, sub) {
21
21
  }
22
22
  function layoutDiv() {
23
23
  var el = '';
24
- if (page.layout == 'wiki' && proj && proj.index != false) {
24
+ if (page.layout == 'wiki') {
25
25
  el += '<div class="logo-wrap wiki">';
26
26
  // all products
27
27
  el += '<a style="filter: grayscale(100%)" class="wiki-home cap" href="' + url_for(config.wiki_dir) + '">';
@@ -39,7 +39,7 @@ function layoutDiv() {
39
39
  }
40
40
  }
41
41
  if (proj != undefined) {
42
- let main = proj.title || proj.wiki || page.wiki || page.title;
42
+ let main = proj.name || proj.title || proj.wiki || page.wiki || page.title;
43
43
  let url = proj.homepage.path;
44
44
  let sub = proj.subtitle;
45
45
  el += layoutTitle(main, url, sub);
@@ -0,0 +1,27 @@
1
+ <%
2
+ function layoutDiv() {
3
+ var el = '';
4
+ el += '<nav class="menu dis-select';
5
+ if (where == 'main') {
6
+ el += ' mobile-hidden';
7
+ }
8
+ el += '">';
9
+ for (let id of Object.keys(theme.sidebar.menu)) {
10
+ let item = theme.sidebar.menu[id];
11
+ if (item == undefined || item.length == 0) {
12
+ continue;
13
+ }
14
+ el += '<a class="nav-item';
15
+ if (id == page.menu_id) {
16
+ el += ' active';
17
+ }
18
+ el += '" href="' + url_for(md_link(item)) + '">';
19
+ el += __(md_text(item));
20
+ el += '</a>';
21
+ }
22
+ el += '</nav>';
23
+ return el;
24
+ }
25
+ %>
26
+
27
+ <%- layoutDiv() %>
@@ -0,0 +1,46 @@
1
+ <%
2
+ function layoutDiv() {
3
+ var el = '';
4
+ var repo;
5
+ var branch = 'main';
6
+ if (page.layout === 'wiki' && page.wiki) {
7
+ let proj = theme.wiki.projects[page.wiki];
8
+ if (proj && proj.repo) {
9
+ repo = proj.repo;
10
+ if (proj.branch != undefined) {
11
+ branch = proj.branch;
12
+ }
13
+ }
14
+ } else {
15
+ // 其它的如果有设置 repo 也可以
16
+ repo = page.repo;
17
+ }
18
+ if (repo == undefined) {
19
+ return el;
20
+ }
21
+ item.api = 'https://api.github.com/repos/' + repo + '/issues?per_page=' + item.limit;
22
+ if (item.labels) {
23
+ item.api += '&labels=' + item.labels;
24
+ }
25
+ console.log(item.api);
26
+ el += '<div class="widget-wrap" id="timeline">';
27
+ if (item.title) {
28
+ el += '<div class="widget-header cap theme dis-select">';
29
+ el += '<span class="name">' + item.title + '</span>';
30
+ el += '</div>';
31
+ }
32
+ el += '<div class="widget-body fs14">';
33
+ el += '<div class="tag-plugin timeline stellar-timeline-api"';
34
+ ['api', 'user'].forEach(key => {
35
+ if (item[key]) {
36
+ el += ' ' + key + '="' + item[key] + '"';
37
+ }
38
+ });
39
+ el += '>';
40
+ el += '</div>';
41
+ el += '</div>';
42
+ el += '</div>';
43
+ return el;
44
+ }
45
+ %>
46
+ <%- layoutDiv() %>
@@ -26,7 +26,7 @@ function layoutDiv() {
26
26
  el += '<a class="repo" href="https://github.com/' + repo + '" target="_blank" rel="external nofollow noopener noreferrer">';
27
27
  el += '<div class="repo-name flex-row">';
28
28
  el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="user-select:none;overflow:visible"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg>';
29
- el += '<span>' + repo + '</span>';
29
+ el += repo;
30
30
  el += '</div>';
31
31
  el += '<div class="repo-desc"><span type="text" id="description">&nbsp;</span></div>';
32
32
  el += '<div class="grid">';
@@ -38,9 +38,9 @@ function layoutDiv() {
38
38
  el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="user-select:none;overflow:visible"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg>';
39
39
  el += '<span type="text" id="forks_count"></span>';
40
40
  el += '</div>';
41
- el += '<div class="flex-row stellar-ghinfo-api" api="https://api.github.xaoxuu.com/repos/' + repo + '/releases/latest">';
41
+ el += '<div class="flex-row stellar-ghinfo-api" index="0" api="https://api.github.xaoxuu.com/repos/' + repo + '/tags">';
42
42
  el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="user-select:none;overflow:visible"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 01.25-.25h5.025a.25.25 0 01.177.073l6.25 6.25a.25.25 0 010 .354l-5.025 5.025a.25.25 0 01-.354 0l-6.25-6.25a.25.25 0 01-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 010 2.474l-5.026 5.026a1.75 1.75 0 01-2.474 0l-6.25-6.25A1.75 1.75 0 011 7.775zM6 5a1 1 0 100 2 1 1 0 000-2z"></path></svg>';
43
- el += '<span type="text" id="tag_name"></span>';
43
+ el += '<span type="text" id="latest-tag-name">0</span>';
44
44
  el += '</div>';
45
45
  el += '</div>';
46
46
  el += '</a>';
@@ -45,6 +45,10 @@ function layoutDiv() {
45
45
  el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1rem" height="1rem" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>';
46
46
  el += 'Follow';
47
47
  el += '</a>';
48
+ // menu
49
+ if (item.menu) {
50
+ el += partial('../menu', {where: 'sidebar'});
51
+ }
48
52
  el += '</div>';
49
53
  el += '</div>';
50
54
  return el;
@@ -5,7 +5,7 @@ function layoutDiv() {
5
5
  return el;
6
6
  }
7
7
  el += '<div class="widget-wrap" id="markdown">';
8
- el += '<div class="widget-header cap dis-select">';
8
+ el += '<div class="widget-header cap theme dis-select">';
9
9
  el += '<span class="name">' + item.title + '</span>';
10
10
  el += '</div>';
11
11
  el += '<div class="widget-body fs14">';
@@ -2,7 +2,7 @@
2
2
  function layoutDiv() {
3
3
  var el = '<div class="widget-wrap" id="recent">';
4
4
  // header
5
- el += '<div class="widget-header cap dis-select">';
5
+ el += '<div class="widget-header cap theme dis-select">';
6
6
  el += '<span class="name">' + __("meta.recent_update") + '</span>';
7
7
  if (item.rss) {
8
8
  el += '<a class="cap-action" id="rss" title="Subscribe" href="' + item.rss + '">';
@@ -25,23 +25,20 @@ function layoutDiv() {
25
25
  return p.title && p.title.length > 0;
26
26
  });
27
27
  }
28
- el += '<div class="widget-body fs14">';
28
+ el += '<div class="widget-body related-posts fs14">';
29
29
  arr.sort("updated", -1).limit(item.limit).each(function(post) {
30
- el += '<div class="more-item">';
31
- el += '<a class="title" href="' + url_for(post.link || post.path) + '">';
30
+ el += '<a class="item title" href="' + url_for(post.link || post.path) + '">';
31
+ el += '<span class="title">'
32
32
  if (post.layout == 'wiki') {
33
- el += '<span>';
34
33
  let proj = theme.wiki.projects[post.wiki];
35
- if (proj && proj.title) {
36
- el += proj.title + __('symbol.colon');
34
+ if (proj && proj.name) {
35
+ el += proj.name + ' / ';
37
36
  } else if (post.wiki) {
38
- el += post.wiki + __('symbol.colon');
37
+ el += post.wiki + ' / ';
39
38
  }
40
- el += '</span>';
41
39
  }
42
- el += post.title || post.seo_title || post.wiki;
40
+ el += (post.title || post.seo_title || post.wiki) + '</span>';
43
41
  el += '</a>';
44
- el += '</div>';
45
42
  el += '';
46
43
  });
47
44
  el += '</div>';
@@ -16,21 +16,21 @@ function layoutDiv() {
16
16
  var el = '';
17
17
  if (related.length > 0) {
18
18
  el += '<div class="widget-wrap" id="related">';
19
- el += '<div class="widget-header cap dis-select">';
19
+ el += '<div class="widget-header cap theme dis-select">';
20
20
  var title = __('btn.wiki');
21
21
  if (proj.tags && proj.tags[0]) {
22
22
  title = proj.tags[0];
23
23
  }
24
24
  el += '<span class="name">' + __('meta.more', title) + '</span>';
25
25
  el += '</div>';
26
- el += '<div class="widget-body fs14">';
26
+ el += '<div class="widget-body related-posts">';
27
27
  related.forEach((p, i) => {
28
28
  // 同一个分组中的其它项目
29
- el += '<a class="more-item wiki" href="' + url_for(p.homepage.path) + '">';
30
- el += p.title;
31
- el += '<div class="excerpt">';
32
- el += p.description;
33
- el += '</div>';
29
+ el += '<a class="item wiki" href="' + url_for(p.homepage.path) + '">';
30
+ el += '<span class="title">' + p.title + '</span>';
31
+ if (p.description && p.description.length > 0) {
32
+ el += '<span class="excerpt">' + p.description + '</span>';
33
+ }
34
34
  el += '</a>';
35
35
  });
36
36
  el += '</div>';
@@ -0,0 +1,24 @@
1
+ <%
2
+ function layoutDiv() {
3
+ var el = '';
4
+ if (site.tags == undefined || site.tags.length == 0) {
5
+ return el;
6
+ }
7
+ var opts = Object.assign({}, item);
8
+ delete opts['title'];
9
+ delete opts['layout'];
10
+ opts.class = 'tag ';
11
+ el += '<div class="widget-wrap" id="tagcloud">';
12
+ if (item.title) {
13
+ el += '<div class="widget-header cap theme dis-select">';
14
+ el += '<span class="name">' + item.title + '</span>';
15
+ el += '</div>';
16
+ }
17
+ el += '<div class="widget-body fs14">';
18
+ el += tagcloud(site.tags, opts);
19
+ el += '</div>';
20
+ el += '</div>';
21
+ return el;
22
+ }
23
+ %>
24
+ <%- layoutDiv() %>
@@ -0,0 +1,27 @@
1
+ <%
2
+ function layoutDiv() {
3
+ var el = '';
4
+ if (item.api == undefined) {
5
+ return el;
6
+ }
7
+ el += '<div class="widget-wrap" id="timeline">';
8
+ if (item.title) {
9
+ el += '<div class="widget-header cap theme dis-select">';
10
+ el += '<span class="name">' + item.title + '</span>';
11
+ el += '</div>';
12
+ }
13
+ el += '<div class="widget-body fs14">';
14
+ el += '<div class="tag-plugin timeline stellar-timeline-api"';
15
+ ['api', 'user'].forEach(key => {
16
+ if (item[key]) {
17
+ el += ' ' + key + '="' + item[key] + '"';
18
+ }
19
+ });
20
+ el += '>';
21
+ el += '</div>';
22
+ el += '</div>';
23
+ el += '</div>';
24
+ return el;
25
+ }
26
+ %>
27
+ <%- layoutDiv() %>
@@ -15,11 +15,7 @@ function layoutToc() {
15
15
  function layoutTocHeader(title) {
16
16
  var el = '';
17
17
  el += '<div class="widget-header cap dis-select">';
18
- if (title) {
19
- el += '<span class="name">' + title + '</span>';
20
- } else {
21
- el += '<span class="name">' + __("meta.toc") + '</span>';
22
- }
18
+ el += '<span class="name">' + (title || page.title || __("meta.toc")) + '</span>';
23
19
  el += '</div>';
24
20
  return el;
25
21
  }
package/layout/index.ejs CHANGED
@@ -13,7 +13,7 @@ if (page.title && page.wiki) {
13
13
  function layout_post_card(layout, post, content) {
14
14
  var el = '';
15
15
  var layout = layout;
16
- if (layout == 'post' && post.cover != undefined && post.cover_info != undefined) {
16
+ if (layout == 'post' && post['cover'] != undefined && post['cover-title'] != undefined) {
17
17
  layout += ' photo';
18
18
  }
19
19
  el += '<a class="post-card ' + layout + ' ' + scrollreveal() + '" href="' + url_for(post.link || post.path) + '">';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {