hexo-theme-stellar 1.7.0 → 1.8.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.
- package/_config.yml +72 -25
- package/layout/404.ejs +1 -1
- package/layout/_partial/head.ejs +2 -11
- package/layout/_partial/main/article/article_footer.ejs +4 -4
- package/layout/_partial/main/post_list/paginator.ejs +2 -2
- package/layout/_partial/main/post_list/post_card.ejs +1 -1
- package/layout/_partial/plugins/comments/valine/script.ejs +1 -1
- package/layout/_partial/plugins/comments/waline/layout.ejs +19 -0
- package/layout/_partial/plugins/comments/waline/script.ejs +22 -0
- package/layout/_partial/scripts/index.ejs +1 -1
- package/package.json +1 -1
- package/scripts/tags/grid.js +35 -0
- package/scripts/tags/note.js +7 -22
- package/scripts/tags/{site.js → sites.js} +3 -0
- package/source/css/_custom.styl +1 -1
- package/source/css/_layout/sidebar/sidebar.styl +2 -2
- package/source/css/_layout/tag-plugins/frame.styl +1 -1
- package/source/css/_layout/tag-plugins/inline-labels.styl +3 -0
- package/source/js/main.js +16 -2
- package/source/js/plugins/friends.js +1 -1
- package/source/js/plugins/sites.js +2 -2
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.
|
|
3
|
+
version: '1.8.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
|
|
@@ -87,7 +87,7 @@ article:
|
|
|
87
87
|
|
|
88
88
|
######## Comments ########
|
|
89
89
|
comments:
|
|
90
|
-
service: # beaudar, utterances, valine, twikoo
|
|
90
|
+
service: # beaudar, utterances, valine, twikoo, waline
|
|
91
91
|
# beaudar
|
|
92
92
|
# https://beaudar.lipk.org/
|
|
93
93
|
beaudar:
|
|
@@ -110,7 +110,7 @@ comments:
|
|
|
110
110
|
theme: preferred-color-scheme
|
|
111
111
|
label:
|
|
112
112
|
valine:
|
|
113
|
-
js: https://
|
|
113
|
+
js: https://fastly.jsdelivr.net/gh/XuxuGood/simple-blog-cdn@main/js/Valine.min.js
|
|
114
114
|
appId: # your appId
|
|
115
115
|
appKey: # your appKey
|
|
116
116
|
placeholder:
|
|
@@ -134,23 +134,69 @@ comments:
|
|
|
134
134
|
# Twikoo
|
|
135
135
|
# https://twikoo.js.org/
|
|
136
136
|
twikoo:
|
|
137
|
-
js: https://
|
|
137
|
+
js: https://fastly.jsdelivr.net/npm/twikoo@1.4.0/dist/twikoo.all.min.js # 建议锁定版本
|
|
138
138
|
envId: https://xxx # vercel函数
|
|
139
|
+
waline:
|
|
140
|
+
js: https://unpkg.com/@waline/client@v2/dist/waline.js
|
|
141
|
+
css: https://unpkg.com/@waline/client@v2/dist/waline.css
|
|
142
|
+
# Waline server address url, you should set this to your own link
|
|
143
|
+
serverURL:
|
|
144
|
+
|
|
145
|
+
# If false, comment count will only be displayed in post page, not in home page
|
|
146
|
+
commentCount: true
|
|
147
|
+
|
|
148
|
+
# Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`.
|
|
149
|
+
pageview: false
|
|
150
|
+
|
|
151
|
+
# Custom locales
|
|
152
|
+
# locale:
|
|
153
|
+
# placeholder: Welcome to comment # Comment box placeholder
|
|
154
|
+
|
|
155
|
+
# Custom emoji
|
|
156
|
+
# emoji:
|
|
157
|
+
# - https://unpkg.com/@waline/emojis@1.0.1/weibo
|
|
158
|
+
# - https://unpkg.com/@waline/emojis@1.0.1/alus
|
|
159
|
+
# - https://unpkg.com/@waline/emojis@1.0.1/bilibili
|
|
160
|
+
# - https://unpkg.com/@waline/emojis@1.0.1/qq
|
|
161
|
+
# - https://unpkg.com/@waline/emojis@1.0.1/tieba
|
|
162
|
+
# - https://unpkg.com/@waline/emojis@1.0.1/tw-emoji
|
|
163
|
+
|
|
164
|
+
# Comment infomation, valid meta are nick, mail and link
|
|
165
|
+
# meta:
|
|
166
|
+
# - nick
|
|
167
|
+
# - mail
|
|
168
|
+
# - link
|
|
169
|
+
|
|
170
|
+
# Set required meta field, e.g.: [nick] | [nick, mail]
|
|
171
|
+
# requiredMeta:
|
|
172
|
+
# - nick
|
|
173
|
+
|
|
174
|
+
# Language, available values: en-US, zh-CN, zh-TW, pt-BR, ru-RU, jp-JP
|
|
175
|
+
# lang: zh-CN
|
|
176
|
+
|
|
177
|
+
# Word limit, no limit when setting to 0
|
|
178
|
+
# wordLimit: 0
|
|
179
|
+
|
|
180
|
+
# Whether enable login, can choose from 'enable', 'disable' and 'force'
|
|
181
|
+
# login: enable
|
|
182
|
+
|
|
183
|
+
# comment per page
|
|
184
|
+
# pageSize: 10
|
|
139
185
|
|
|
140
186
|
######## Footer ########
|
|
141
187
|
footer:
|
|
142
188
|
social:
|
|
143
189
|
# github:
|
|
144
|
-
# icon: '<img src="https://
|
|
190
|
+
# icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/08a41b181ce68.svg"/>'
|
|
145
191
|
# url: /
|
|
146
192
|
# music:
|
|
147
|
-
# icon: '<img src="https://
|
|
193
|
+
# icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3845874.svg"/>'
|
|
148
194
|
# url: /
|
|
149
195
|
# unsplash:
|
|
150
|
-
# icon: '<img src="https://
|
|
196
|
+
# icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3616429.svg"/>'
|
|
151
197
|
# url: /
|
|
152
198
|
# comments:
|
|
153
|
-
# icon: '<img src="https://
|
|
199
|
+
# icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/942ebbf1a4b91.svg"/>'
|
|
154
200
|
# url: /about/#comments
|
|
155
201
|
sitemap:
|
|
156
202
|
# '博客':
|
|
@@ -188,11 +234,11 @@ tag_plugins:
|
|
|
188
234
|
prefix: https://s2.loli.net/2022/01/04/UvHcsa73jQPnobq.png
|
|
189
235
|
# {% emoji %}
|
|
190
236
|
emoji:
|
|
191
|
-
default: https://
|
|
192
|
-
twemoji: https://
|
|
193
|
-
qq: https://
|
|
194
|
-
aru: https://
|
|
195
|
-
tieba: https://
|
|
237
|
+
default: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
|
|
238
|
+
twemoji: https://fastly.jsdelivr.net/gh/twitter/twemoji/assets/svg/%s.svg
|
|
239
|
+
qq: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
|
|
240
|
+
aru: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/aru-l/%s.gif
|
|
241
|
+
tieba: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/tieba/%s.png
|
|
196
242
|
# {% image %}
|
|
197
243
|
image:
|
|
198
244
|
fancybox: # true, false
|
|
@@ -202,7 +248,7 @@ tag_plugins:
|
|
|
202
248
|
plugins:
|
|
203
249
|
## required plugins ##
|
|
204
250
|
# jquery
|
|
205
|
-
jquery: https://
|
|
251
|
+
jquery: https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
|
|
206
252
|
|
|
207
253
|
# issues api
|
|
208
254
|
sitesjs: /js/plugins/sites.js
|
|
@@ -213,20 +259,20 @@ plugins:
|
|
|
213
259
|
preload:
|
|
214
260
|
enable: true
|
|
215
261
|
service: flying_pages # instant_page, flying_pages
|
|
216
|
-
instant_page: https://
|
|
217
|
-
flying_pages: https://
|
|
262
|
+
instant_page: https://fastly.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js
|
|
263
|
+
flying_pages: https://fastly.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js
|
|
218
264
|
|
|
219
265
|
# image lazyload
|
|
220
266
|
# https://www.npmjs.com/package/vanilla-lazyload
|
|
221
267
|
lazyload:
|
|
222
268
|
enable: true # [hexo clean && hexo s] is required after changing this value.
|
|
223
|
-
js: https://
|
|
269
|
+
js: https://fastly.jsdelivr.net/npm/vanilla-lazyload@17.3.1/dist/lazyload.min.js
|
|
224
270
|
transition: blur # blur, fade
|
|
225
271
|
|
|
226
272
|
# https://scrollrevealjs.org/api/reveal.html
|
|
227
273
|
scrollreveal:
|
|
228
274
|
enable: #true
|
|
229
|
-
js: https://
|
|
275
|
+
js: https://fastly.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js
|
|
230
276
|
distance: 8px
|
|
231
277
|
duration: 500 # ms
|
|
232
278
|
interval: 100 # ms
|
|
@@ -236,11 +282,12 @@ plugins:
|
|
|
236
282
|
# available for {% image xxx %}
|
|
237
283
|
fancybox:
|
|
238
284
|
enable: true
|
|
239
|
-
js: https://
|
|
240
|
-
css: https://
|
|
285
|
+
js: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js
|
|
286
|
+
css: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css
|
|
241
287
|
# 可以处理评论区的图片(不支持 iframe 类评论系统)例如:
|
|
242
288
|
# 使用valine评论可以写: .vcontent img:not(.vemoji)
|
|
243
289
|
# 使用twikoo评论可以写: .tk-content img:not([class*="emo"])
|
|
290
|
+
# 使用waline评论可以写: #waline_container .vcontent img
|
|
244
291
|
selector: .swiper-slide img # 多个选择器用英文逗号隔开
|
|
245
292
|
|
|
246
293
|
# swiper
|
|
@@ -265,12 +312,12 @@ style:
|
|
|
265
312
|
dark: '#313438'
|
|
266
313
|
animated_avatar:
|
|
267
314
|
animate: auto # auto, always
|
|
268
|
-
background: https://
|
|
315
|
+
background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp
|
|
269
316
|
codeblock:
|
|
270
317
|
scrollbar: 4px
|
|
271
318
|
|
|
272
319
|
default:
|
|
273
|
-
avatar: https://
|
|
274
|
-
link: https://
|
|
275
|
-
cover: https://
|
|
276
|
-
image: https://
|
|
320
|
+
avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg
|
|
321
|
+
link: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg
|
|
322
|
+
cover: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg
|
|
323
|
+
image: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg
|
package/layout/404.ejs
CHANGED
|
@@ -6,7 +6,7 @@ page.header = false;
|
|
|
6
6
|
page.robots = 'none';
|
|
7
7
|
%>
|
|
8
8
|
<article class='md error-page'>
|
|
9
|
-
<h1><img id='error' src='https://
|
|
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>
|
|
12
12
|
<%- __('page.error.what') %>
|
package/layout/_partial/head.ejs
CHANGED
|
@@ -49,8 +49,8 @@ function og_args() {
|
|
|
49
49
|
<%- generate_robots() %>
|
|
50
50
|
|
|
51
51
|
<meta http-equiv='x-dns-prefetch-control' content='on' />
|
|
52
|
-
<link rel='dns-prefetch' href='https://
|
|
53
|
-
<link rel="preconnect" href="https://
|
|
52
|
+
<link rel='dns-prefetch' href='https://fastly.jsdelivr.net'>
|
|
53
|
+
<link rel="preconnect" href="https://fastly.jsdelivr.net" crossorigin>
|
|
54
54
|
<link rel='dns-prefetch' href='//unpkg.com'>
|
|
55
55
|
|
|
56
56
|
<meta name="renderer" content="webkit">
|
|
@@ -62,15 +62,6 @@ function og_args() {
|
|
|
62
62
|
<meta name="theme-color" content="#f8f8f8">
|
|
63
63
|
<title><%- generate_title() %></title>
|
|
64
64
|
|
|
65
|
-
<% if (theme.heti) { %>
|
|
66
|
-
<link rel="stylesheet" href="//unpkg.com/heti/umd/heti.min.css">
|
|
67
|
-
<script src="//unpkg.com/heti/umd/heti-addon.min.js"></script>
|
|
68
|
-
<script defer>
|
|
69
|
-
const heti = new Heti('.heti');
|
|
70
|
-
heti.autoSpacing(); // 自动进行中西文混排美化和标点挤压
|
|
71
|
-
</script>
|
|
72
|
-
<% } %>
|
|
73
|
-
|
|
74
65
|
<% if (theme.open_graph && theme.open_graph.enable) { %>
|
|
75
66
|
<%- open_graph(og_args()) %>
|
|
76
67
|
<% } %>
|
|
@@ -85,13 +85,13 @@ function layoutDiv() {
|
|
|
85
85
|
}
|
|
86
86
|
el += '>';
|
|
87
87
|
if (item == 'wechat') {
|
|
88
|
-
el += '<img src="https://
|
|
88
|
+
el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/b32ef3da1162a.svg"/>';
|
|
89
89
|
} else if (item == 'weibo') {
|
|
90
|
-
el += '<img src="https://
|
|
90
|
+
el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/80c07e4dbb303.svg"/>';
|
|
91
91
|
} else if (item == 'email') {
|
|
92
|
-
el += '<img src="https://
|
|
92
|
+
el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/a1b00e20f425d.svg"/>';
|
|
93
93
|
} else if (item == 'link') {
|
|
94
|
-
el += '<img src="https://
|
|
94
|
+
el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/8411ed322ced6.svg"/>';
|
|
95
95
|
}
|
|
96
96
|
el += '</a>';
|
|
97
97
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<% if (is_home() && page.total > 1) { %>
|
|
2
2
|
<div class='paginator-wrap dis-select'>
|
|
3
3
|
<a class='paginator prev<%- page.prev != 0 ? "" : " disable" %>' href='<%- url_for(page.prev_link) %>'>
|
|
4
|
-
<img src='https://
|
|
4
|
+
<img src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/f049bbd4e88ec.svg'/>
|
|
5
5
|
</a>
|
|
6
6
|
<div class='paginator current'>
|
|
7
7
|
<%- page.current %><span class='sep'></span><%- page.total %>
|
|
8
8
|
</div>
|
|
9
9
|
<a class='paginator next<%- page.next != 0 ? "" : " disable" %>' href='<%- url_for(page.next_link) %>'>
|
|
10
|
-
<img src='https://
|
|
10
|
+
<img src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/064b95430caf4.svg'/>
|
|
11
11
|
</a>
|
|
12
12
|
</div>
|
|
13
13
|
<% } %>
|
|
@@ -80,7 +80,7 @@ function div_default() {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
if (post.pin) {
|
|
83
|
-
el += '<span class="pin"><img src="https://
|
|
83
|
+
el += '<span class="pin"><img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/badge/3279dd441df8b.svg"/></span>';
|
|
84
84
|
}
|
|
85
85
|
el += '</div>';
|
|
86
86
|
el += '</article>';
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
el: '#valine_container',
|
|
36
36
|
path: path,
|
|
37
37
|
placeholder: placeholder,
|
|
38
|
-
emojiCDN: 'https://
|
|
38
|
+
emojiCDN: 'https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/',
|
|
39
39
|
emojiMaps: getEmojiMaps(),
|
|
40
40
|
}));
|
|
41
41
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<%
|
|
2
|
+
function layoutDiv() {
|
|
3
|
+
var el = '';
|
|
4
|
+
el += '<div id="waline_container" class="waline_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() %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
function load_comment(){
|
|
3
|
+
if(!document.getElementById("waline_container"))return;
|
|
4
|
+
stellar.loadCSS('<%- theme.comments.waline.css %>');
|
|
5
|
+
stellar.loadScript('<%- theme.comments.waline.js %>', {defer:true}).then(function () {
|
|
6
|
+
const el = document.getElementById("waline_container");
|
|
7
|
+
var path = el.getAttribute('comment_id');
|
|
8
|
+
if (!path) {
|
|
9
|
+
path = decodeURI(window.location.pathname);
|
|
10
|
+
}
|
|
11
|
+
Waline.init(Object.assign(<%- JSON.stringify(theme.comments.waline) %>, {
|
|
12
|
+
el: '#waline_container',
|
|
13
|
+
path: path,
|
|
14
|
+
}));
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
window.addEventListener('DOMContentLoaded', (event) => {
|
|
18
|
+
console.log('DOM fully loaded and parsed');
|
|
19
|
+
load_comment();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
</script>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
// required plugins (only load if needs)
|
|
105
105
|
stellar.plugins = {
|
|
106
|
-
jQuery: '<%- url_for(theme.plugins.jquery || "https://
|
|
106
|
+
jQuery: '<%- url_for(theme.plugins.jquery || "https://fastly.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js") %>',
|
|
107
107
|
sitesjs: '<%- url_for(theme.plugins.sitesjs) %>',
|
|
108
108
|
friendsjs: '<%- url_for(theme.plugins.friendsjs) %>',
|
|
109
109
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grid.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% grid [color:color] [child:codeblock/tabs] title %}
|
|
6
|
+
* body
|
|
7
|
+
* {% endgrid %}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
hexo.extend.tag.register('grid', function(args, content) {
|
|
13
|
+
args = hexo.args.map(args, ['color', 'child'], ['title']);
|
|
14
|
+
const color = args.color;
|
|
15
|
+
const title = args.title;
|
|
16
|
+
var el = '';
|
|
17
|
+
const defaultColor = hexo.theme.config.tag_plugins.note.default_color;
|
|
18
|
+
if (!color && defaultColor) {
|
|
19
|
+
color = defaultColor;
|
|
20
|
+
}
|
|
21
|
+
// header
|
|
22
|
+
el += '<div class="tag-plugin note"';
|
|
23
|
+
el += ' ' + hexo.args.joinTags(args, ['color', 'child']).join(' ');
|
|
24
|
+
el += '>';
|
|
25
|
+
// title
|
|
26
|
+
if (title && title.length > 0) {
|
|
27
|
+
el += '<div class="title"><strong>' + title + '</strong></div>';
|
|
28
|
+
}
|
|
29
|
+
// content
|
|
30
|
+
el += '<div class="body">';
|
|
31
|
+
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
32
|
+
el += '</div></div>';
|
|
33
|
+
|
|
34
|
+
return el;
|
|
35
|
+
}, {ends: true});
|
package/scripts/tags/note.js
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
* note.js v1.1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
3
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
4
|
*
|
|
5
|
-
* note:
|
|
6
5
|
* {% note [color:color] [title] content %}
|
|
7
|
-
*
|
|
8
|
-
* noteblock:
|
|
9
|
-
* {% noteblock [color:color] [child:codeblock/tabs] title %}
|
|
10
|
-
* markdown content
|
|
11
|
-
* {% endnoteblock %}
|
|
12
6
|
*/
|
|
13
7
|
|
|
14
8
|
'use strict';
|
|
15
9
|
|
|
16
|
-
function
|
|
10
|
+
hexo.extend.tag.register('note', function(args) {
|
|
11
|
+
args = hexo.args.map(args, ['color'], ['title', 'content']);
|
|
12
|
+
if (args.content == undefined || args.content.length <= 0) {
|
|
13
|
+
args.content = args.title;
|
|
14
|
+
args.title = '';
|
|
15
|
+
}
|
|
17
16
|
const color = args.color;
|
|
18
17
|
const title = args.title;
|
|
19
18
|
var el = '';
|
|
@@ -31,22 +30,8 @@ function outputNoteBlock(args, content) {
|
|
|
31
30
|
}
|
|
32
31
|
// content
|
|
33
32
|
el += '<div class="body">';
|
|
34
|
-
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
33
|
+
el += hexo.render.renderSync({text: args.content, engine: 'markdown'}).split('\n').join('');
|
|
35
34
|
el += '</div></div>';
|
|
36
35
|
|
|
37
36
|
return el;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
hexo.extend.tag.register('note', function(args) {
|
|
41
|
-
args = hexo.args.map(args, ['color'], ['title', 'content']);
|
|
42
|
-
if (args.content == undefined || args.content.length <= 0) {
|
|
43
|
-
args.content = args.title;
|
|
44
|
-
args.title = '';
|
|
45
|
-
}
|
|
46
|
-
return outputNoteBlock(args, args.content);
|
|
47
37
|
});
|
|
48
|
-
|
|
49
|
-
hexo.extend.tag.register('noteblock', function(args, content) {
|
|
50
|
-
args = hexo.args.map(args, ['color', 'child'], ['title']);
|
|
51
|
-
return outputNoteBlock(args, content);
|
|
52
|
-
}, {ends: true});
|
|
@@ -62,6 +62,9 @@ hexo.extend.tag.register('sites', function(args) {
|
|
|
62
62
|
}
|
|
63
63
|
if (groupId in sites) {
|
|
64
64
|
let group = sites[groupId];
|
|
65
|
+
if ((typeof group == 'object') && group.constructor == Array) {
|
|
66
|
+
group = {items: group};
|
|
67
|
+
}
|
|
65
68
|
if (group.title || group.description) {
|
|
66
69
|
el += groupHeader(group);
|
|
67
70
|
}
|
package/source/css/_custom.styl
CHANGED
|
@@ -32,7 +32,7 @@ $dark-site-bg-mobile = black
|
|
|
32
32
|
|
|
33
33
|
// @font-face
|
|
34
34
|
// font-family: 'Dosis'
|
|
35
|
-
// src: url('https://
|
|
35
|
+
// src: url('https://fastly.jsdelivr.net/gh/volantis-x/cdn-fonts@20.5.30/Dosis/Dosis-Medium.ttf')
|
|
36
36
|
// font-weight: normal
|
|
37
37
|
// font-style: normal
|
|
38
38
|
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
if hexo-config('style.animated_avatar.animate') == 'always'
|
|
62
62
|
div.bg
|
|
63
63
|
opacity: 1 !important
|
|
64
|
-
animation: spin infinite
|
|
64
|
+
animation: spin infinite 4s
|
|
65
65
|
animation-timing-function: linear
|
|
66
66
|
if hexo-config('style.animated_avatar.animate') == 'auto'
|
|
67
67
|
&:hover
|
|
68
68
|
div.bg
|
|
69
69
|
opacity: 1 !important
|
|
70
|
-
animation: spin infinite
|
|
70
|
+
animation: spin infinite 4s
|
|
71
71
|
animation-timing-function: linear
|
|
72
72
|
|
|
73
73
|
a.title
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
margin-top: 19px
|
|
28
28
|
margin-bottom: 20px
|
|
29
29
|
.frame
|
|
30
|
-
background-image: url(https://
|
|
30
|
+
background-image: url(https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/frame/iphone11.svg);
|
|
31
31
|
width: 329px
|
|
32
32
|
height: 658px
|
|
33
33
|
&[focus='top']
|
package/source/js/main.js
CHANGED
|
@@ -301,8 +301,22 @@ if (stellar.plugins.fancybox) {
|
|
|
301
301
|
if (stellar.plugins.heti) {
|
|
302
302
|
stellar.loadCSS(stellar.plugins.heti.css);
|
|
303
303
|
stellar.loadScript(stellar.plugins.heti.js, { defer: true }).then(function () {
|
|
304
|
-
const heti = new Heti('.heti
|
|
305
|
-
|
|
304
|
+
const heti = new Heti('.heti');
|
|
305
|
+
|
|
306
|
+
// Copied from heti.autoSpacing() without DOMContentLoaded.
|
|
307
|
+
// https://github.com/sivan/heti/blob/eadee6a3b748b3b7924a9e7d5b395d4bce479c9a/js/heti-addon.js
|
|
308
|
+
//
|
|
309
|
+
// We managed to minimize the code modification to ensure .autoSpacing()
|
|
310
|
+
// is synced with upstream; therefore, we use `.bind()` to emulate the
|
|
311
|
+
// behavior of .autoSpacing() so we can even modify almost no code.
|
|
312
|
+
void (function () {
|
|
313
|
+
const $$rootList = document.querySelectorAll(this.rootSelector)
|
|
314
|
+
|
|
315
|
+
for (let $$root of $$rootList) {
|
|
316
|
+
this.spacingElement($$root)
|
|
317
|
+
}
|
|
318
|
+
}).bind(heti)();
|
|
319
|
+
|
|
306
320
|
stellar.plugins.heti.enable = false;
|
|
307
321
|
});
|
|
308
322
|
}
|
|
@@ -77,7 +77,7 @@ $(function () {
|
|
|
77
77
|
cfg.el = el;
|
|
78
78
|
cfg.api = api;
|
|
79
79
|
cfg.class = el.getAttribute('class');
|
|
80
|
-
cfg.avatar = 'https://
|
|
80
|
+
cfg.avatar = 'https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg';
|
|
81
81
|
friendsjs.layout(cfg);
|
|
82
82
|
}
|
|
83
83
|
});
|
|
@@ -80,8 +80,8 @@ $(function () {
|
|
|
80
80
|
cfg.class = el.getAttribute('class');
|
|
81
81
|
cfg.el = el;
|
|
82
82
|
cfg.api = api;
|
|
83
|
-
cfg.avatar = 'https://
|
|
84
|
-
cfg.screenshot = 'https://
|
|
83
|
+
cfg.avatar = 'https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg';
|
|
84
|
+
cfg.screenshot = 'https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg';
|
|
85
85
|
sitesjs.layout(cfg);
|
|
86
86
|
}
|
|
87
87
|
});
|