hexo-theme-stellar 1.9.0 → 1.10.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 (56) hide show
  1. package/_config.yml +47 -19
  2. package/languages/en.yml +0 -5
  3. package/languages/zh-CN.yml +0 -5
  4. package/languages/zh-TW.yml +0 -5
  5. package/layout/404.ejs +1 -1
  6. package/layout/_partial/main/footer.ejs +6 -17
  7. package/layout/_partial/main/header/index.ejs +1 -1
  8. package/layout/_partial/plugins/comments/valine/script.ejs +1 -1
  9. package/layout/_partial/scripts/index.ejs +5 -3
  10. package/layout/_partial/sidebar/index.ejs +3 -1
  11. package/layout/_partial/sidebar/widgets/ghuser.ejs +59 -0
  12. package/layout/_partial/sidebar/widgets/repo_info.ejs +28 -9
  13. package/layout/post.ejs +1 -1
  14. package/layout/wiki.ejs +1 -1
  15. package/package.json +1 -1
  16. package/scripts/tags/about.js +12 -13
  17. package/scripts/tags/friends.js +2 -3
  18. package/scripts/tags/ghcard.js +2 -2
  19. package/scripts/tags/lib/users.js +1 -2
  20. package/scripts/tags/sites.js +2 -3
  21. package/scripts/tags/timeline.js +30 -25
  22. package/source/css/_common/base.styl +2 -9
  23. package/source/css/_common/button.styl +1 -1
  24. package/source/css/_common/device.styl +2 -2
  25. package/source/css/_common/highlight.styl +4 -3
  26. package/source/css/_common/html.styl +2 -0
  27. package/source/css/_common/loading.styl +5 -0
  28. package/source/css/_common/pre.styl +6 -0
  29. package/source/css/_custom.styl +17 -1
  30. package/source/css/_defines/const.styl +1 -0
  31. package/source/css/_defines/theme.styl +1 -1
  32. package/source/css/_layout/layout.styl +2 -2
  33. package/source/css/_layout/main.styl +2 -2
  34. package/source/css/_layout/md.styl +35 -1
  35. package/source/css/_layout/partial/footer.styl +3 -7
  36. package/source/css/_layout/partial/navbar.styl +1 -1
  37. package/source/css/_layout/partial/paginator.styl +4 -0
  38. package/source/css/_layout/partial/related.styl +2 -0
  39. package/source/css/_layout/sidebar/ghuser.styl +80 -0
  40. package/source/css/_layout/sidebar/repo_info.styl +4 -1
  41. package/source/css/_layout/sidebar/sidebar.styl +2 -2
  42. package/source/css/_layout/tag-plugins/about.styl +13 -16
  43. package/source/css/_layout/tag-plugins/common.styl +1 -1
  44. package/source/css/_layout/tag-plugins/friends.styl +3 -6
  45. package/source/css/_layout/tag-plugins/inline-labels.styl +1 -0
  46. package/source/css/_layout/tag-plugins/link.styl +2 -1
  47. package/source/css/_layout/tag-plugins/note.styl +8 -0
  48. package/source/css/_layout/tag-plugins/sites.styl +2 -6
  49. package/source/css/_layout/tag-plugins/tabs.styl +5 -0
  50. package/source/css/_layout/tag-plugins/timeline.styl +85 -2
  51. package/source/css/_layout/tag-plugins/toc.styl +1 -1
  52. package/source/js/main.js +13 -15
  53. package/source/js/plugins/friends.js +1 -2
  54. package/source/js/plugins/ghinfo.js +73 -0
  55. package/source/js/plugins/sites.js +1 -1
  56. package/source/js/plugins/timeline.js +122 -0
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.9.0'
3
+ version: '1.10.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,7 +25,7 @@ sidebar:
25
25
  # about: '[关于](/about/)'
26
26
  # Sidebar widgets
27
27
  widget_layout:
28
- index: [welcome, recent] # for home/wiki/categories/tags/archives/404 pages
28
+ index: [welcome, recent, ghuser_mini] # for home/wiki/categories/tags/archives/404 pages
29
29
  page: [welcome, toc] # for pages using 'layout:page'
30
30
  post: [toc, repo_info] # for pages using 'layout:post'
31
31
  wiki: [toc, repo_info, wiki_more] # for pages using 'layout:wiki'
@@ -42,6 +42,18 @@ sidebar:
42
42
  min_depth: 2
43
43
  max_depth: 5
44
44
  fallback: recent # Use a backup widget when toc does not exist.
45
+ # github user info
46
+ ghuser:
47
+ layout: ghuser
48
+ api: https://api.github.com
49
+ username: github # your github login username
50
+ avatar: true
51
+ ghuser_mini:
52
+ layout: ghuser
53
+ header: # GitHub Info
54
+ api: https://api.github.com
55
+ username: github # your github login username
56
+ avatar: false
45
57
  # welcome
46
58
  welcome:
47
59
  layout: markdown
@@ -75,7 +87,7 @@ article:
75
87
  category_color:
76
88
  '新闻稿': '#DA0F47'
77
89
  # 文章许可协议
78
- license: '本文采用 [署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/) 许可协议,转载请注明出处。'
90
+ license: '本文采用[署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/)许可协议,转载请注明出处。'
79
91
  # 分享
80
92
  share: # [wechat, weibo, email, link]
81
93
  # 相关文章,需要安装插件 (for layout: post)
@@ -172,12 +184,13 @@ comments:
172
184
 
173
185
  # Custom emoji
174
186
  # emoji:
175
- # - https://unpkg.com/@waline/emojis@1.0.1/weibo
176
- # - https://unpkg.com/@waline/emojis@1.0.1/alus
177
- # - https://unpkg.com/@waline/emojis@1.0.1/bilibili
178
- # - https://unpkg.com/@waline/emojis@1.0.1/qq
179
- # - https://unpkg.com/@waline/emojis@1.0.1/tieba
180
- # - https://unpkg.com/@waline/emojis@1.0.1/tw-emoji
187
+ # - https://unpkg.com/@waline/emojis@1.1.0/weibo
188
+ # - https://unpkg.com/@waline/emojis@1.1.0/alus
189
+ # - https://unpkg.com/@waline/emojis@1.1.0/bilibili
190
+ # - https://unpkg.com/@waline/emojis@1.1.0/qq
191
+ # - https://unpkg.com/@waline/emojis@1.1.0/tieba
192
+ # - https://unpkg.com/@waline/emojis@1.1.0/tw-emoji
193
+ # - https://unpkg.com/@waline/emojis@1.1.0/bmoji
181
194
 
182
195
  # Comment infomation, valid meta are nick, mail and link
183
196
  # meta:
@@ -230,9 +243,10 @@ footer:
230
243
  # '更多':
231
244
  # - '[关于本站](/)'
232
245
  # - '[GitHub](/)'
233
- license: # '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
234
- source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)'
235
- more: # string or array (support markdown)
246
+ content: | # 支持 Markdown 格式
247
+ 本站由 [@anonymity](/) 使用 [Stellar](https://github.com/xaoxuu/hexo-theme-stellar) 主题创建。
248
+ 本博客所有文章除特别声明外,均采用 [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) 许可协议,转载请注明出处。
249
+ # 主题用户越多,开发者维护和更新的积极性就越高,如果您喜欢本主题,请在适当的位置显示主题信息和仓库链接以表支持。
236
250
 
237
251
 
238
252
  ######## Tag Plugins ########
@@ -252,14 +266,17 @@ tag_plugins:
252
266
  prefix: https://s2.loli.net/2022/01/04/UvHcsa73jQPnobq.png
253
267
  # {% emoji %}
254
268
  emoji:
255
- default: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
269
+ default: https://fastly.jsdelivr.net/gh/cdn-x/emoji/qq/%s.gif
256
270
  twemoji: https://fastly.jsdelivr.net/gh/twitter/twemoji/assets/svg/%s.svg
257
- qq: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
258
- aru: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/aru-l/%s.gif
259
- tieba: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/tieba/%s.png
271
+ qq: https://fastly.jsdelivr.net/gh/cdn-x/emoji/qq/%s.gif
272
+ aru: https://fastly.jsdelivr.net/gh/cdn-x/emoji/aru-l/%s.gif
273
+ tieba: https://fastly.jsdelivr.net/gh/cdn-x/emoji/tieba/%s.png
260
274
  # {% image %}
261
275
  image:
262
276
  fancybox: # true, false
277
+ # {% timeline %}
278
+ timeline:
279
+ max-height: 80vh
263
280
 
264
281
 
265
282
  ######## JS Plugins ########
@@ -268,9 +285,15 @@ plugins:
268
285
  # jquery
269
286
  jquery: https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
270
287
 
271
- # issues api
272
- sitesjs: /js/plugins/sites.js
273
- friendsjs: /js/plugins/friends.js
288
+ # stellar api
289
+ stellar:
290
+ sites: /js/plugins/sites.js
291
+ friends: /js/plugins/friends.js
292
+ ghinfo: /js/plugins/ghinfo.js
293
+ timeline: /js/plugins/timeline.js
294
+
295
+
296
+ marked: https://cdn.bootcdn.net/ajax/libs/marked/4.0.18/marked.min.js
274
297
 
275
298
  ## optional plugins ##
276
299
  # preload
@@ -341,6 +364,11 @@ plugins:
341
364
 
342
365
  style:
343
366
  darkmode: auto # auto / always / false
367
+ smooth_scroll: true # true / false
368
+ font-family:
369
+ logo: system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
370
+ body: system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
371
+ code: Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif
344
372
  theme:
345
373
  light: '#f8f8f8'
346
374
  dark: '#313438'
package/languages/en.yml CHANGED
@@ -36,11 +36,6 @@ meta:
36
36
  day: days ago
37
37
  month: months ago
38
38
 
39
- footer:
40
- license: 'All articles in this blog are licensed under %s unless stating additionally.'
41
- info_not_open_source: 'This site was deployed by %s using %s.'
42
- info_open_source: 'This site was deployed by %s using %s. You can find the source code in %s.'
43
-
44
39
  page:
45
40
  error:
46
41
  what: Page Not Found
@@ -36,11 +36,6 @@ meta:
36
36
  day: 天前
37
37
  month: 个月前
38
38
 
39
- footer:
40
- license: '本博客所有文章除特别声明外,均采用 %s 许可协议,转载请注明出处。'
41
- info_not_open_source: '本站由 %s 使用 %s 主题创建。'
42
- info_open_source: '本站由 %s 使用 %s 主题创建,您可以在 %s 找到本站源码。'
43
-
44
39
  page:
45
40
  error:
46
41
  what: 很抱歉,您访问的页面不存在
@@ -36,11 +36,6 @@ meta:
36
36
  day: 天前
37
37
  month: 個月前
38
38
 
39
- footer:
40
- license: '本網誌所有文章除特別聲明外,均採用 %s 授權條款。轉載請註明出處。'
41
- info_not_open_source: '本站由 %s 使用 %s 主題建立。'
42
- info_open_source: '本站由 %s 使用 %s 主題建立。您可以在 %s 找到本站原始碼。'
43
-
44
39
  page:
45
40
  error:
46
41
  what: 抱歉,找不到您存取的頁面
package/layout/404.ejs CHANGED
@@ -2,7 +2,7 @@
2
2
  page.menu_id = '404';
3
3
  page.layout = '404';
4
4
  page.comment_title = '';
5
- page.header = false;
5
+ page.header = 'auto';
6
6
  page.robots = 'none';
7
7
  %>
8
8
  <article class='md error-page'>
@@ -1,8 +1,5 @@
1
1
  <%
2
- const author = '[@' + config.author + '](' + config.url + config.root + ')';
3
- const using = '[' + stellar_info('name') + '](' + stellar_info('tree') + ' "v' + stellar_info('version') + '")';
4
- const source = theme.footer.source;
5
- const more = theme.footer.more;
2
+ const content = theme.footer.content;
6
3
  function layoutDiv() {
7
4
  var el = '';
8
5
  el += '<footer class="page-footer reveal fs12">';
@@ -28,19 +25,11 @@ function layoutDiv() {
28
25
  }
29
26
  // footer
30
27
  el += '<div class="text">';
31
- if (theme.footer.license) {
32
- el += markdown(__('footer.license', theme.footer.license));
33
- }
34
- if (source) {
35
- el += markdown(__('footer.info_open_source', author, using, source));
36
- } else {
37
- el += markdown(__('footer.info_not_open_source', author, using));
38
- }
39
- if (more) {
40
- if ((typeof more == 'string') && more.constructor == String) {
41
- el += markdown(more);
42
- } else if ((typeof more == 'object') && more.constructor == Array) {
43
- more.forEach((item, i) => {
28
+ if (content) {
29
+ if ((typeof content == 'string') && content.constructor == String) {
30
+ el += markdown(content);
31
+ } else if ((typeof content == 'object') && content.constructor == Array) {
32
+ content.forEach((item, i) => {
44
33
  el += markdown(item);
45
34
  });
46
35
  }
@@ -1,3 +1,3 @@
1
- <% if (page.header != false) { %>
1
+ <% if (page.header != 'auto' && page.header != false) { %>
2
2
  <%- partial('../../sidebar/header', {where: 'main'}) %>
3
3
  <% } %>
@@ -35,7 +35,7 @@
35
35
  el: '#valine_container',
36
36
  path: path,
37
37
  placeholder: placeholder,
38
- emojiCDN: 'https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/',
38
+ emojiCDN: 'https://fastly.jsdelivr.net/gh/cdn-x/emoji/valine/',
39
39
  emojiMaps: getEmojiMaps(),
40
40
  }));
41
41
  });
@@ -103,11 +103,13 @@
103
103
 
104
104
  // required plugins (only load if needs)
105
105
  stellar.plugins = {
106
- jQuery: '<%- url_for(theme.plugins.jquery || "https://fastly.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js") %>',
107
- sitesjs: '<%- url_for(theme.plugins.sitesjs) %>',
108
- friendsjs: '<%- url_for(theme.plugins.friendsjs) %>',
106
+ jQuery: '<%- url_for(theme.plugins.jquery || "https://fastly.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js") %>'
109
107
  };
110
108
 
109
+ // stellar js
110
+ stellar.plugins.stellar = Object.assign(<%- JSON.stringify(theme.plugins.stellar) %>);
111
+
112
+ stellar.plugins.marked = Object.assign(<%- JSON.stringify(theme.plugins.marked) %>);
111
113
  // optional plugins
112
114
  if ('<%- theme.plugins.lazyload.enable %>' == 'true') {
113
115
  stellar.plugins.lazyload = Object.assign(<%- JSON.stringify(theme.plugins.lazyload) %>);
@@ -69,6 +69,8 @@ function layoutFooterDiv() {
69
69
  }
70
70
  }
71
71
  %>
72
- <%- partial('header', {where: 'sidebar'}) %>
72
+ <% if (page.header == undefined || page.header == 'left' || page.header == 'auto') { %>
73
+ <%- partial('header', {where: 'sidebar'}) %>
74
+ <% } %>
73
75
  <%- layoutWidgets() %>
74
76
  <%- layoutFooterDiv() %>
@@ -0,0 +1,59 @@
1
+ <%
2
+ var btns = [];
3
+ btns.push({
4
+ key: 'followers',
5
+ desc: 'followers',
6
+ href: '?tab=followers'
7
+ });
8
+ btns.push({
9
+ key: 'following',
10
+ desc: 'following',
11
+ href: '?tab=following'
12
+ });
13
+ btns.push({
14
+ key: 'public_repos',
15
+ desc: 'repos',
16
+ href: '?tab=repositories'
17
+ });
18
+
19
+ function layoutDiv() {
20
+ var el = '';
21
+ if (item.username == undefined || item.username.length == 0) {
22
+ return el;
23
+ }
24
+
25
+ el += '<div class="widget-wrap" id="github-user">';
26
+ // header
27
+ if (item.header && item.header.length > 0) {
28
+ el += '<div class="widget-header cap dis-select">';
29
+ el += '<span class="name">' + item.header + '</span>';
30
+ el += '</div>';
31
+ }
32
+ // body
33
+ el += '<div class="widget-body stellar-ghinfo-api" api="' + item.api + '/users/' + item.username + '">';
34
+ if (item.avatar) {
35
+ el += '<div class="avatar" ><img no-lazy type="img" id="avatar_url" src="' + config.avatar + '"></div>';
36
+ }
37
+ // username
38
+ el += '<p class="username" type="text" id="name" href="https://github.com/' + item.username + '">&nbsp;</p>';
39
+ el += '<p class="bio" type="text" id="bio">&nbsp;</p>';
40
+
41
+ el += '<div class="buttons">';
42
+ btns.forEach((btn, i) => {
43
+ el += '<a class="btn" href="https://github.com/' + item.username + '' + btn.href + '">';
44
+ el += '<span class="title" type="text" id="' + btn.key + '">0</span>';
45
+ el += '<span class="desc">' + btn.desc + '</span>';
46
+ el += '</a>';
47
+ });
48
+ el += '</div>';
49
+ // follow
50
+ el += '<a class="follow" href="https://github.com/' + item.username + '">';
51
+ 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>';
52
+ el += 'Follow';
53
+ el += '</a>';
54
+ el += '</div>';
55
+ el += '</div>';
56
+ return el;
57
+ }
58
+ %>
59
+ <%- layoutDiv() %>
@@ -26,7 +26,7 @@ function layoutDiv() {
26
26
  el += '</div>';
27
27
  // body
28
28
  el += '<div class="widget-body fs14">';
29
- el += '<div class="items">';
29
+ el += '<div class="items stellar-ghinfo-api" api="https://api.github.xaoxuu.com/repos/' + repo + '">';
30
30
  var items = [];
31
31
  // GitHub
32
32
  items.push({
@@ -34,6 +34,20 @@ function layoutDiv() {
34
34
  text: 'GitHub',
35
35
  href: 'https://github.com/' + repo
36
36
  });
37
+ // Stars
38
+ items.push({
39
+ icon: '<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 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"></path></svg>',
40
+ text: 'Stars',
41
+ apiKey: 'stargazers_count',
42
+ href: 'https://github.com/' + repo + '/stargazers'
43
+ });
44
+ // Forks
45
+ items.push({
46
+ icon: '<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="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>',
47
+ text: 'Forks',
48
+ apiKey: 'forks_count',
49
+ href: 'https://github.com/' + repo + '/network/members'
50
+ });
37
51
  // Releases
38
52
  items.push({
39
53
  icon: '<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="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,15 +57,9 @@ function layoutDiv() {
43
57
  // Download
44
58
  items.push({
45
59
  icon: '<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="M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"></path></svg>',
46
- text: 'Download',
60
+ text: 'Download Zip',
47
61
  href: 'https://github.com/' + repo + '/archive/refs/heads/' + branch + '.zip'
48
62
  });
49
- // Issues
50
- items.push({
51
- icon: '<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 d="M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path><path fill-rule="evenodd" d="M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"></path></svg>',
52
- text: 'Issues',
53
- href: 'https://github.com/' + repo + '/issues'
54
- });
55
63
  items.forEach((item, i) => {
56
64
  el += '<div class="line"></div>';
57
65
  el += '<a class="item-link"';
@@ -59,8 +67,19 @@ function layoutDiv() {
59
67
  el += ' href="' + url_for(item.href) + '"';
60
68
  el += ' target="_blank" rel="external nofollow noopener noreferrer"';
61
69
  el += '>';
62
- el += item.icon;
70
+ // left
71
+ el += '<div class="left">';
63
72
  el += '<span>' + item.text + '</span>';
73
+ el += '</div>';
74
+ // right
75
+ el += '<div class="right">';
76
+ if (item.apiKey) {
77
+ el += '<span type="text" id="' + item.apiKey + '"></span>';
78
+ }
79
+ if (item.icon) {
80
+ el += item.icon;
81
+ }
82
+ el += '</div>';
64
83
  el += '</a>';
65
84
  });
66
85
  el += '</div>';
package/layout/post.ejs CHANGED
@@ -3,7 +3,7 @@ if (page.menu_id == undefined) {
3
3
  page.menu_id = 'post';
4
4
  }
5
5
  if (page.header == undefined) {
6
- page.header = false;
6
+ page.header = 'auto';
7
7
  }
8
8
  function layoutTitle() {
9
9
  const title = page.h1 || page.title;
package/layout/wiki.ejs CHANGED
@@ -26,7 +26,7 @@ function layoutTitle() {
26
26
  <% } else { %>
27
27
  <%
28
28
  if (page.header == undefined) {
29
- page.header = false;
29
+ page.header = 'auto';
30
30
  }
31
31
  %>
32
32
  <%- partial('_partial/main/navbar/breadcrumb') %>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -10,30 +10,29 @@
10
10
  'use strict';
11
11
 
12
12
  hexo.extend.tag.register('about', function(args, content) {
13
- args = hexo.args.map(args, ['avatar', 'height']);
13
+ args = hexo.args.map(args, ['avatar', 'height', 'border']);
14
14
  var rows = hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n');
15
15
  var el = '';
16
16
  // wrapper
17
17
  el += '<div class="tag-plugin about">';
18
18
  el += '<div class="about-header">';
19
19
  // avatar
20
- if (args.avatar) {
20
+ var avatar_url = args.avatar;
21
+ if (args.avatar === undefined) {
22
+ avatar_url = hexo.config.avatar;
23
+ }
24
+ if (avatar_url) {
21
25
  el += '<div class="avatar">'
22
- el += '<img src="' + args.avatar + '"';
26
+ el += '<img src="' + avatar_url + '"';
27
+ if (args.border && args.border.length > 0) {
28
+ el += ' style="border-radius:' + args.border + '"';
29
+ }
23
30
  if (args.height && args.height.length > 0) {
24
- el += ' height="' + args.height + '"/>';
25
- } else {
26
- el += '/>';
31
+ el += ' height="' + args.height + '"';
27
32
  }
33
+ el += '/>';
28
34
  el += '</div>';
29
35
  }
30
- // title
31
- if (rows.length > 0) {
32
- // el += '<div class="title">';
33
- el += rows.shift();
34
- // el += '</div>';
35
- }
36
-
37
36
  el += '</div>';
38
37
 
39
38
  // content
@@ -65,9 +65,8 @@ hexo.extend.tag.register('friends', function(args) {
65
65
  el += groupHeader(group);
66
66
  }
67
67
  if (group.repo) {
68
- el += '<div class="friendsjs-wrap"';
69
- el += ' id="friends-api"';
70
- el += ' api="' + (group.api || 'https://issues-api.vercel.app') + '/v1/' + group.repo + '"';
68
+ el += '<div class="stellar-friends-api"';
69
+ el += ' api="' + (group.api || 'https://issues-api.xaoxuu.com') + '/v1/' + group.repo + '"';
71
70
  el += '>';
72
71
  el += '<div class="group-body"></div>';
73
72
  el += '</div>';
@@ -24,10 +24,10 @@ hexo.extend.tag.register('ghcard', function(args) {
24
24
  if (path.includes('/')) {
25
25
  // is repo
26
26
  const ps = path.split('/');
27
- url += 'https://github-readme-stats.vercel.app/api/pin/?username=' + ps[0] + '&repo=' + ps[1];
27
+ url += 'https://github-readme-stats.xaoxuu.com/api/pin/?username=' + ps[0] + '&repo=' + ps[1];
28
28
  } else {
29
29
  // is user
30
- url += 'https://github-readme-stats.vercel.app/api/?username=' + path;
30
+ url += 'https://github-readme-stats.xaoxuu.com/api/?username=' + path;
31
31
  }
32
32
  url += '&' + hexo.args.joinURLParams(args, params);
33
33
  if (!url.includes('&show_owner=')) {
@@ -11,8 +11,7 @@ module.exports = ctx => function(args) {
11
11
  args = ctx.args.map(args, ['api']);
12
12
  var el = '<div class="tag-plugin users-wrap">';
13
13
 
14
- el += '<div class="friendsjs-wrap"';
15
- el += ' id="friends-api"';
14
+ el += '<div class="stellar-friends-api"';
16
15
  el += ' api="' + args.api + '"';
17
16
  el += '>';
18
17
  el += '<div class="group-body"></div>';
@@ -69,9 +69,8 @@ hexo.extend.tag.register('sites', function(args) {
69
69
  el += groupHeader(group);
70
70
  }
71
71
  if (group.repo) {
72
- el += '<div class="sitesjs-wrap"';
73
- el += ' id="sites-api"';
74
- el += ' api="' + (group.api || 'https://issues-api.vercel.app') + '/v1/' + group.repo + '"';
72
+ el += '<div class="stellar-sites-api"';
73
+ el += ' api="' + (group.api || 'https://issues-api.xaoxuu.com') + '/v1/' + group.repo + '"';
75
74
  el += '>';
76
75
  el += '<div class="group-body"></div>';
77
76
  el += '</div>';
@@ -36,36 +36,41 @@ function layoutNodeContent(content) {
36
36
 
37
37
 
38
38
  function postTimeline(args, content) {
39
+ args = hexo.args.map(args, ['api']);
39
40
  var el = '';
41
+
42
+ if (args.api && args.api.length > 0) {
43
+ el += '<div class="tag-plugin timeline stellar-timeline-api" api="' + args.api + '">';
44
+ } else {
45
+ el += '<div class="tag-plugin timeline">';
46
+ }
47
+
40
48
  var arr = content.split(/<!--\s*(.*?)\s*-->/g).filter((item, i) => {
41
49
  return item.trim().length > 0;
42
50
  });
43
- if (arr.length < 1) {
44
- return el;
45
- }
46
- var nodes = [];
47
- arr.forEach((item, i) => {
48
- if (item.startsWith('node ')) {
49
- nodes.push({
50
- header: item
51
- });
52
- } else if (nodes.length > 0) {
53
- var node = nodes[nodes.length-1];
54
- if (node.body == undefined) {
55
- node.body = item;
56
- } else {
57
- node.body += '\n' + item;
51
+ if (arr.length > 0) {
52
+ var nodes = [];
53
+ arr.forEach((item, i) => {
54
+ if (item.startsWith('node ')) {
55
+ nodes.push({
56
+ header: item
57
+ });
58
+ } else if (nodes.length > 0) {
59
+ var node = nodes[nodes.length-1];
60
+ if (node.body == undefined) {
61
+ node.body = item;
62
+ } else {
63
+ node.body += '\n' + item;
64
+ }
58
65
  }
59
- }
60
- });
61
-
62
- el += '<div class="tag-plugin timeline">';
63
- nodes.forEach((node, i) => {
64
- el += '<div class="timenode" item="' + (i + 1) + '">';
65
- el += layoutNodeTitle(node.header.substring(5));
66
- el += layoutNodeContent(node.body);
67
- el += '</div>';
68
- });
66
+ });
67
+ nodes.forEach((node, i) => {
68
+ el += '<div class="timenode" index="' + (i) + '">';
69
+ el += layoutNodeTitle(node.header.substring(5));
70
+ el += layoutNodeContent(node.body);
71
+ el += '</div>';
72
+ });
73
+ }
69
74
 
70
75
  el += '</div>';
71
76
  return el;
@@ -12,15 +12,8 @@ a
12
12
  &:hover
13
13
  color: $color-hover
14
14
 
15
- // md > a
16
- p, li
17
- >a:not([class])
18
- margin: 0 1px
19
- padding: 4px
20
- border-radius: 4px
21
- &:hover
22
- color: darken($color-hover, 10)
23
- background: alpha($color-hover, 0.08)
15
+ p:not([class])
16
+ text-align: justify
24
17
 
25
18
  hr
26
19
  color: var(--text-meta)
@@ -14,7 +14,7 @@ a.button
14
14
  font-size: $fs-15
15
15
  &.theme
16
16
  background: $color-theme
17
- color: var(--site-bg)
17
+ color: var(--card)
18
18
  &:hover
19
19
  background: $color-hover
20
20
 
@@ -1,10 +1,10 @@
1
1
  .mobile-only
2
2
  display: none
3
- @media screen and (max-width: $device-tablet)
3
+ @media screen and (max-width: $device-mobile-max)
4
4
  display: block !important
5
5
 
6
6
  .mobile-hidden
7
- @media screen and (max-width: $device-tablet)
7
+ @media screen and (max-width: $device-mobile-max)
8
8
  display: none !important
9
9
 
10
10
  .float-panel