hexo-theme-stellar 1.11.0 → 1.13.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 (78) hide show
  1. package/README.md +7 -7
  2. package/_config.yml +22 -37
  3. package/_data/links.yml +7 -0
  4. package/_data/widgets.yml +30 -6
  5. package/languages/zh-CN.yml +4 -4
  6. package/languages/zh-TW.yml +4 -4
  7. package/layout/_partial/head.ejs +2 -0
  8. package/layout/_partial/main/article/read_next.ejs +16 -17
  9. package/layout/_partial/main/navbar/breadcrumb.ejs +1 -1
  10. package/layout/_partial/main/navbar/list_post.ejs +57 -34
  11. package/layout/_partial/main/post_list/post_card.ejs +25 -15
  12. package/layout/_partial/main/post_list/wiki_card.ejs +1 -1
  13. package/layout/_partial/scripts/index.ejs +1 -0
  14. package/layout/_partial/sidebar/header.ejs +2 -26
  15. package/layout/_partial/sidebar/logo.ejs +2 -2
  16. package/layout/_partial/sidebar/menu.ejs +27 -0
  17. package/layout/_partial/sidebar/widgets/ghissues.ejs +45 -0
  18. package/layout/_partial/sidebar/widgets/ghrepo.ejs +3 -3
  19. package/layout/_partial/sidebar/widgets/ghuser.ejs +4 -0
  20. package/layout/_partial/sidebar/widgets/markdown.ejs +1 -1
  21. package/layout/_partial/sidebar/widgets/recent.ejs +8 -11
  22. package/layout/_partial/sidebar/widgets/{wiki_more.ejs → related.ejs} +7 -7
  23. package/layout/_partial/sidebar/widgets/tagcloud.ejs +24 -0
  24. package/layout/_partial/sidebar/widgets/timeline.ejs +27 -0
  25. package/layout/_partial/sidebar/widgets/toc.ejs +1 -5
  26. package/layout/index.ejs +1 -1
  27. package/layout/page.ejs +19 -10
  28. package/package.json +1 -1
  29. package/scripts/events/lib/config.js +1 -1
  30. package/scripts/events/lib/doc_tree.js +3 -0
  31. package/scripts/helpers/related_posts.js +11 -39
  32. package/scripts/tags/about.js +10 -7
  33. package/scripts/tags/{grid.js → border.js} +4 -4
  34. package/scripts/tags/friends.js +36 -75
  35. package/scripts/tags/link.js +11 -9
  36. package/scripts/tags/navbar.js +1 -1
  37. package/scripts/tags/sites.js +40 -79
  38. package/scripts/tags/split.js +51 -0
  39. package/scripts/tags/timeline.js +6 -4
  40. package/source/css/_common/base.styl +2 -2
  41. package/source/css/_common/blur.styl +3 -0
  42. package/source/css/_common/device.styl +2 -0
  43. package/source/css/_common/highlight.styl +1 -1
  44. package/source/css/_common/loading.styl +16 -3
  45. package/source/css/_common/title.styl +0 -13
  46. package/source/css/_custom.styl +4 -4
  47. package/source/css/_layout/list.styl +40 -12
  48. package/source/css/_layout/main.styl +1 -1
  49. package/source/css/_layout/md.styl +1 -4
  50. package/source/css/_layout/partial/navbar.styl +1 -1
  51. package/source/css/_layout/partial/related.styl +62 -93
  52. package/source/css/_layout/sidebar/footer.styl +4 -2
  53. package/source/css/_layout/sidebar/ghrepo.styl +11 -5
  54. package/source/css/_layout/sidebar/ghuser.styl +19 -1
  55. package/source/css/_layout/sidebar/sidebar.styl +11 -96
  56. package/source/css/_layout/sidebar/toc_common.styl +5 -3
  57. package/source/css/_layout/sidebar/widgets.styl +103 -0
  58. package/source/css/_layout/tag-plugins/about.styl +21 -18
  59. package/source/css/_layout/tag-plugins/common.styl +36 -31
  60. package/source/css/_layout/tag-plugins/link.styl +41 -27
  61. package/source/css/_layout/tag-plugins/navbar.styl +10 -4
  62. package/source/css/_layout/tag-plugins/quot.styl +1 -1
  63. package/source/css/_layout/tag-plugins/split.styl +32 -0
  64. package/source/css/_layout/tag-plugins/timeline.styl +40 -14
  65. package/source/css/_plugins/comments/twikoo.styl +11 -5
  66. package/source/css/_plugins/comments/waline.styl +5 -1
  67. package/source/css/_plugins/index.styl +0 -2
  68. package/source/js/main.js +15 -9
  69. package/source/js/plugins/fcircle.js +92 -0
  70. package/source/js/plugins/friends.js +3 -2
  71. package/source/js/plugins/ghinfo.js +14 -2
  72. package/source/js/plugins/linkcard.js +124 -0
  73. package/source/js/plugins/sites.js +4 -3
  74. package/source/js/plugins/timeline.js +58 -40
  75. package/layout/_partial/plugins/comments/valine/layout.ejs +0 -19
  76. package/layout/_partial/plugins/comments/valine/script.ejs +0 -48
  77. package/scripts/tags/issues.js +0 -30
  78. package/source/css/_plugins/comments/valine.styl +0 -218
@@ -1,19 +0,0 @@
1
- <%
2
- function layoutDiv() {
3
- var el = '';
4
- el += '<div id="valine_container" class="valine_thread"';
5
- let cfg = {};
6
- if (page.comment_id) {
7
- cfg['comment_id'] = page.comment_id;
8
- }
9
- for (let key of Object.keys(cfg)) {
10
- if (cfg[key]) {
11
- el += ' ' + key + '="' + cfg[key] + '"';
12
- }
13
- }
14
- el += '><svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg></div>';
15
- return el;
16
- }
17
- %>
18
-
19
- <%- layoutDiv() %>
@@ -1,48 +0,0 @@
1
- <script>
2
- function getEmojiMaps() {
3
- function emoji(path, idx, ext) {
4
- return path + "/" + path + "-" + idx + "." + ext;
5
- }
6
- var emojiMaps = {};
7
- for (var i = 1; i <= 54; i++) {
8
- emojiMaps['tieba-' + i] = emoji('tieba', i, 'png');
9
- }
10
- for (var i = 1; i <= 101; i++) {
11
- emojiMaps['qq-' + i] = emoji('qq', i, 'gif');
12
- }
13
- for (var i = 1; i <= 116; i++) {
14
- emojiMaps['aru-' + i] = emoji('aru', i, 'gif');
15
- }
16
- for (var i = 1; i <= 125; i++) {
17
- emojiMaps['twemoji-' + i] = emoji('twemoji', i, 'png');
18
- }
19
- for (var i = 1; i <= 4; i++) {
20
- emojiMaps['weibo-' + i] = emoji('weibo', i, 'png');
21
- }
22
- return emojiMaps;
23
- }
24
- function load_comment(){
25
- if(!document.getElementById("valine_container"))return;
26
- stellar.loadScript('<%- theme.comments.valine.js %>', {defer:true}).then(function () {
27
- const el = document.getElementById("valine_container");
28
- var path = el.getAttribute('comment_id');
29
- const placeholder = "<%= theme.comments.valine.placeholder %>";
30
- if (!path) {
31
- path = decodeURI(window.location.pathname);
32
- }
33
- var valine = new Valine();
34
- valine.init(Object.assign(<%- JSON.stringify(theme.comments.valine) %>, {
35
- el: '#valine_container',
36
- path: path,
37
- placeholder: placeholder,
38
- emojiCDN: 'https://fastly.jsdelivr.net/gh/cdn-x/emoji/valine/',
39
- emojiMaps: getEmojiMaps(),
40
- }));
41
- });
42
- }
43
- window.addEventListener('DOMContentLoaded', (event) => {
44
- console.log('DOM fully loaded and parsed');
45
- load_comment();
46
- });
47
-
48
- </script>
@@ -1,30 +0,0 @@
1
- /**
2
- * issues.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
3
- * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
- *
5
- * {% issues [sites/timeline/friends] api:xxx [group:key=value1,value2,value3] %}
6
- *
7
- * example:
8
- * {% issues sites api:https://api.github.com/repos/volantis-x/examples/issues?sort=updated&state=open&page=1&per_page=100 group:version=版本:^4.0,版本:^3.0,版本:^2.0 %}
9
- */
10
-
11
- 'use strict';
12
-
13
- hexo.extend.tag.register('issues', function(args) {
14
- args = hexo.args.map(args, ['api', 'group'], ['type']);
15
- // 所有支持的参数
16
- let type = args.type || '';
17
- let api = args.api || '';
18
- let group = args.group || '';
19
- if (type.length == 0 || api.length == 0) {
20
- return;
21
- }
22
- // 布局
23
- var el = '<div class="tag-plugin issues-wrap ' + type + '" id="issues-api"';
24
- el += 'api="' + api + '"';
25
- if (group.length > 0) {
26
- el += 'group="' + group + '"';
27
- }
28
- el += '></div>';
29
- return el;
30
- });
@@ -1,218 +0,0 @@
1
- .cmt-body.valine
2
- --more-before: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(246, 246, 246, .9))
3
- --more-after: rgba(246, 246, 246, .9)
4
- margin-top: 1rem
5
- #valine_container
6
- line-height: 1.5 !important
7
- img
8
- display: inline
9
- .vwrap
10
- background: var(--card)
11
- border-radius: $border-block
12
- border-style: dashed
13
- border: 1px dashed var(--text-meta)
14
- &:hover
15
- border-color: $color-theme
16
- .vheader
17
- border-color: $color-theme
18
- .cancel-reply
19
- margin-top: 0
20
- margin-bottom: 0
21
- .vheader
22
- margin: -10px
23
- padding: 5px 10px 0
24
- background: var(--site-bg)
25
- border-bottom: 1px dashed var(--text-meta)
26
- .vinput
27
- border: none
28
- .vnick
29
- margin-left: 0;
30
- .vedit
31
- .vicon
32
- height: 22px
33
- .vemojis,.vpreview
34
- background: var(--block)
35
- border-radius: 4px
36
- padding: 0.5rem
37
- scrollbar(0, 0)
38
- .vemoji
39
- max-height: 22px
40
- max-width: 100px
41
- i
42
- width: auto
43
- padding: 8px
44
- border-radius: 4px
45
- trans2: box-shadow background
46
- &:hover
47
- background: linear-gradient(145deg, #eee, #fff)
48
- box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1), -1px -1px 2px rgba(255, 255, 255, 0.5), inset 8px 8px 16px rgba(0, 0, 0, 0.05), inset -8px -8px 16px rgba(255, 255, 255, 0.4)
49
- if hexo-config('style.darkmode') == 'auto'
50
- @media (prefers-color-scheme: dark)
51
- box-shadow: none
52
- &:active
53
- background: linear-gradient(145deg, #eee, #fff)
54
- box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1), -0px -0px 0px rgba(255, 255, 255, 0.8), inset 2px 2px 4px rgba(0, 0, 0, 0.1), inset -2px -2px 4px rgba(255, 255, 255, 1), inset -8px -8px 16px rgba(255, 255, 255, 0.4)
55
- if hexo-config('style.darkmode') == 'auto'
56
- @media (prefers-color-scheme: dark)
57
- box-shadow: none
58
- .vedit
59
- .vctrl span
60
- padding: 0
61
- margin: 10px
62
- span
63
- fill: var(--text-p1)
64
- &.actived
65
- fill: $color-theme
66
- .vcount
67
- color: var(--text-p1)
68
- font-size: $fs-13
69
- padding: 0
70
- font-weight: inherit
71
- .vnum
72
- color: var(--text-p1)
73
- font-size: $fs-h2
74
- font-weight: 700
75
-
76
- button
77
- border: none
78
- padding: 4px 2rem
79
- border-radius: 4px
80
- background: var(--block)
81
- color: var(--text-p1)
82
- line-height: 2
83
- font-size: 14px
84
- font-weight: 500
85
- trans()
86
- &:hover
87
- background: var(--block-hover)
88
- &.vmore
89
- width: 100%
90
- padding: 8px 2rem
91
- .vcards
92
- margin-top: 0.5rem
93
- .vcard
94
- display: flex
95
- position: relative
96
- .vcontent.expand
97
- &:before
98
- background: var(--more-before);
99
- &:after
100
- background: var(--more-after);
101
- .vimg
102
- width: 40px
103
- height: 40px
104
- z-index: 1
105
- .vh
106
- margin-left: -46px
107
- padding-bottom: 0
108
- width: 100%
109
- position: relative
110
- .vhead
111
- line-height: 1.2
112
- .vnick
113
- margin-left: 44px
114
- line-height: inherit
115
- font-size: $fs-14
116
- .vtime
117
- margin-left: 44px
118
- font-size: $fs-12
119
- font-weight: 500
120
- .vat
121
- font-size: $fs-12
122
- .vvisitor
123
- display: none
124
- >.vcard
125
- border-radius: $border-block
126
- background: var(--card)
127
- border: 1px dashed var(--block-border)
128
- padding: 1rem
129
- margin-bottom: 1rem
130
- &:hover
131
- border-color: $color-theme;
132
- >.vh
133
- border-bottom: none
134
- >.vquote
135
- border-left: none
136
- padding-left: 0
137
- >.vcard
138
- border-top: 1px dashed var(--block-border)
139
- .vimg
140
- padding: 0
141
- background: var(--block)
142
- .vhead
143
- span.vnick
144
- color: var(--text-p2)
145
- cursor: default
146
- a.vnick
147
- color: #ff9800
148
- font-weight: 700
149
- &:hover
150
- color: $color-hover
151
- .vsys
152
- display: none
153
- .vmeta
154
- position: static !important
155
- .vat
156
- font-weight: bold
157
- color: var(--text-p1)
158
- background: var(--card)
159
- padding: 4px 8px
160
- border-radius: 2px
161
- position: absolute
162
- top: 0
163
- right: 0
164
- &:hover
165
- color: $color-hover
166
- background-color: var(--block)
167
-
168
- .vcontent
169
- padding-top: 0
170
- margin-top: .75em
171
- blockquote
172
- padding-top: 1rem
173
- padding-bottom: 1rem
174
- background: var(--block)
175
- border-left: 3px solid $color-theme
176
- code
177
- color: var(--text-p1)
178
- background: var(--block);
179
- margin: 0 2px;
180
- pre
181
- background: var(--block)
182
- code
183
- border: none
184
- a
185
- color: $color-link
186
- line-height: inherit
187
- trans()
188
- &:hover
189
- color: $color-hover
190
- text-decoration: underline
191
- p
192
- color: var(--text-p1)
193
- line-height: inherit
194
- .vemoji
195
- max-height: 24px
196
- border-radius: 0
197
- margin-top: -10px
198
- max-width: 100px
199
- .vempty
200
- color: var(--color-meta)
201
- .vpower
202
- &,a
203
- font-size: $fs-12
204
- a
205
- color: var(--text-p1)
206
- &:hover
207
- text-decoration: underline
208
- color: $color-hover
209
- .vinput
210
- color: var(--text-p1)
211
- p
212
- color: var(--text-p1)
213
-
214
- if hexo-config('style.darkmode') == 'auto'
215
- @media (prefers-color-scheme: dark)
216
- .cmt-body.valine
217
- --more-before: 0 0
218
- --more-after: #393c40