hexo-theme-stellar 1.5.2 → 1.7.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 +67 -39
- package/languages/en.yml +0 -1
- package/languages/zh-CN.yml +0 -1
- package/languages/zh-TW.yml +0 -1
- package/layout/404.ejs +1 -1
- package/layout/_partial/cover/index.ejs +12 -0
- package/layout/_partial/cover/post_cover.ejs +19 -0
- package/layout/_partial/{main/article → cover}/wiki_cover.ejs +1 -4
- package/layout/_partial/head.ejs +10 -0
- package/layout/_partial/main/article/read_next.ejs +0 -6
- package/layout/_partial/main/post_list/post_card.ejs +42 -4
- package/layout/_partial/main/post_list/wiki_card.ejs +2 -0
- package/layout/_partial/scripts/index.ejs +6 -0
- package/layout/_partial/sidebar/index.ejs +11 -6
- package/layout/_partial/sidebar/widgets/markdown.ejs +18 -10
- package/layout/_partial/sidebar/widgets/recent.ejs +5 -13
- package/layout/_partial/sidebar/widgets/toc.ejs +2 -1
- package/layout/archive.ejs +3 -3
- package/layout/categories.ejs +1 -1
- package/layout/index.ejs +5 -2
- package/layout/layout.ejs +1 -1
- package/layout/post.ejs +6 -2
- package/layout/tags.ejs +1 -1
- package/package.json +1 -1
- package/scripts/events/index.js +5 -7
- package/scripts/tags/friends.js +3 -0
- package/scripts/tags/image.js +21 -1
- package/scripts/tags/link.js +42 -16
- package/scripts/tags/poetry.js +48 -0
- package/scripts/tags/quot.js +51 -0
- package/source/css/_common/device.styl +1 -1
- package/source/css/_common/highlight.styl +2 -1
- package/source/css/_common/title.styl +3 -1
- package/source/css/_custom.styl +5 -4
- package/source/css/_layout/layout.styl +1 -1
- package/source/css/_layout/list.styl +70 -36
- package/source/css/_layout/main.styl +2 -2
- package/source/css/_layout/md.styl +36 -8
- package/source/css/_layout/pages/archives.styl +48 -16
- package/source/css/_layout/partial/cover.styl +50 -10
- package/source/css/_layout/partial/navbar.styl +3 -4
- package/source/css/_layout/partial/related.styl +1 -3
- package/source/css/_layout/sidebar/sidebar.styl +22 -5
- package/source/css/_layout/tag-plugins/about.styl +4 -5
- package/source/css/_layout/tag-plugins/folding.styl +1 -0
- package/source/css/_layout/tag-plugins/friends.styl +2 -1
- package/source/css/_layout/tag-plugins/image.styl +1 -2
- package/source/css/_layout/tag-plugins/link.styl +47 -9
- package/source/css/_layout/tag-plugins/poetry.styl +50 -0
- package/source/css/_layout/tag-plugins/quot.styl +82 -0
- package/source/css/_layout/tag-plugins/sites.styl +2 -2
- package/source/css/_layout/tag-plugins/tabs.styl +2 -2
- package/source/css/_layout/tag-plugins/timeline.styl +1 -1
- package/source/css/_plugins/fancybox.styl +5 -0
- package/source/css/_plugins/index.styl +2 -0
- package/source/js/main.js +46 -13
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.
|
|
3
|
+
version: '1.7.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
|
|
@@ -19,14 +19,17 @@ sidebar:
|
|
|
19
19
|
avatar: '[config.avatar](/about/)' # you can set avatar link in _config.yml or '[https://xxx.png](/about/)'
|
|
20
20
|
title: '[config.title](/)' # you can set html tag like: '[<img no-lazy height="32px" src="xxx"/>](/)'
|
|
21
21
|
menu:
|
|
22
|
-
post:
|
|
23
|
-
wiki:
|
|
24
|
-
friends:
|
|
25
|
-
about:
|
|
22
|
+
# post: '[btn.blog](/)'
|
|
23
|
+
# wiki: '[btn.wiki](/wiki/)'
|
|
24
|
+
# friends: '[友链](/friends/)'
|
|
25
|
+
# about: '[关于](/about/)'
|
|
26
26
|
# Sidebar widgets
|
|
27
|
+
widget_layout:
|
|
28
|
+
index: [welcome, recent] # for home/wiki/categories/tags/archives/404 pages
|
|
29
|
+
page: [welcome, toc] # for pages using 'layout:page'
|
|
30
|
+
post: [toc, repo_info] # for pages using 'layout:post'
|
|
31
|
+
wiki: [toc, repo_info, wiki_more] # for pages using 'layout:wiki'
|
|
27
32
|
widgets:
|
|
28
|
-
# default layout in home/wiki/categories/tags/archives pages
|
|
29
|
-
default_layout: [welcome]
|
|
30
33
|
# Recent update
|
|
31
34
|
recent:
|
|
32
35
|
layout: recent
|
|
@@ -43,22 +46,22 @@ sidebar:
|
|
|
43
46
|
welcome:
|
|
44
47
|
layout: markdown
|
|
45
48
|
title: Stellar 入门指南
|
|
46
|
-
content:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
content: | # support markdown
|
|
50
|
+
欢迎使用 [Stellar](https://github.com/xaoxuu/hexo-theme-stellar/) 主题,下面是您的入门指南,祝您使用愉快!
|
|
51
|
+
<br>
|
|
52
|
+
**第一步**
|
|
53
|
+
创建 `blog/_config.stellar.yml` 文件,在此文件中填写需要自定义的主题配置。
|
|
54
|
+
<br>
|
|
55
|
+
**第二步**
|
|
56
|
+
创建 `blog/source/_data/widgets.yml` 文件,此文件中填写需要自定义的侧边栏组件,例如 `welcome` 组件。
|
|
57
|
+
<br>
|
|
58
|
+
如果有任何疑问,请先查阅[文档](https://xaoxuu.com/wiki/stellar/),如果文档中没有提供,请提 [issue](https://github.com/xaoxuu/hexo-theme-stellar/issues/) 向开发中询问。
|
|
56
59
|
|
|
57
60
|
|
|
58
61
|
|
|
59
62
|
######## Main ########
|
|
60
63
|
breadcrumb:
|
|
61
|
-
home:
|
|
64
|
+
home: home # config.title / config.author / home or custom content
|
|
62
65
|
|
|
63
66
|
######## Article ########
|
|
64
67
|
article:
|
|
@@ -137,18 +140,18 @@ comments:
|
|
|
137
140
|
######## Footer ########
|
|
138
141
|
footer:
|
|
139
142
|
social:
|
|
140
|
-
#
|
|
141
|
-
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
142
|
-
# url: /atom.xml
|
|
143
|
-
# - title: GitHub
|
|
144
|
-
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/08a41b181ce68.svg"/>'
|
|
143
|
+
# github:
|
|
144
|
+
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/08a41b181ce68.svg"/>'
|
|
145
145
|
# url: /
|
|
146
|
-
#
|
|
147
|
-
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
146
|
+
# music:
|
|
147
|
+
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3845874.svg"/>'
|
|
148
148
|
# url: /
|
|
149
|
-
#
|
|
150
|
-
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.
|
|
149
|
+
# unsplash:
|
|
150
|
+
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3616429.svg"/>'
|
|
151
151
|
# url: /
|
|
152
|
+
# comments:
|
|
153
|
+
# icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/942ebbf1a4b91.svg"/>'
|
|
154
|
+
# url: /about/#comments
|
|
152
155
|
sitemap:
|
|
153
156
|
# '博客':
|
|
154
157
|
# - '[近期](/)'
|
|
@@ -157,16 +160,12 @@ footer:
|
|
|
157
160
|
# - '[归档](/)'
|
|
158
161
|
# '项目':
|
|
159
162
|
# - '[开源库](/)'
|
|
160
|
-
# - '[实用脚本](/)'
|
|
161
163
|
# '社交':
|
|
162
164
|
# - '[友链](/)'
|
|
163
165
|
# - '[留言板](/)'
|
|
164
|
-
# - '[Spotify](/)'
|
|
165
|
-
# - '[Unsplash](/)'
|
|
166
166
|
# '更多':
|
|
167
167
|
# - '[关于本站](/)'
|
|
168
168
|
# - '[GitHub](/)'
|
|
169
|
-
# - '[GitLab](/)'
|
|
170
169
|
license: '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
|
|
171
170
|
source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)'
|
|
172
171
|
more: # string or array (support markdown)
|
|
@@ -180,12 +179,23 @@ tag_plugins:
|
|
|
180
179
|
# {% checkbox %}
|
|
181
180
|
checkbox:
|
|
182
181
|
interactive: false # enable interactive for user
|
|
182
|
+
# {% quot %}
|
|
183
|
+
quot:
|
|
184
|
+
default: # 可以自行配置多种图标方案
|
|
185
|
+
prefix: https://s2.loli.net/2022/01/04/vsTB5pGrIHfPxSj.png
|
|
186
|
+
suffix: https://s2.loli.net/2022/01/04/NORdtjlAhifZSns.png
|
|
187
|
+
hashtag:
|
|
188
|
+
prefix: https://s2.loli.net/2022/01/04/UvHcsa73jQPnobq.png
|
|
189
|
+
# {% emoji %}
|
|
183
190
|
emoji:
|
|
184
191
|
default: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
|
|
185
192
|
twemoji: https://cdn.jsdelivr.net/gh/twitter/twemoji/assets/svg/%s.svg
|
|
186
193
|
qq: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
|
|
187
194
|
aru: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/aru-l/%s.gif
|
|
188
195
|
tieba: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/tieba/%s.png
|
|
196
|
+
# {% image %}
|
|
197
|
+
image:
|
|
198
|
+
fancybox: # true, false
|
|
189
199
|
|
|
190
200
|
|
|
191
201
|
######## JS Plugins ########
|
|
@@ -194,14 +204,6 @@ plugins:
|
|
|
194
204
|
# jquery
|
|
195
205
|
jquery: https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
|
|
196
206
|
|
|
197
|
-
## lazyload plugins ##
|
|
198
|
-
# fancybox
|
|
199
|
-
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
|
|
200
|
-
# swiper
|
|
201
|
-
swiper:
|
|
202
|
-
enable: true
|
|
203
|
-
css: https://unpkg.com/swiper@6/swiper-bundle.min.css
|
|
204
|
-
js: https://unpkg.com/swiper@6/swiper-bundle.min.js
|
|
205
207
|
# issues api
|
|
206
208
|
sitesjs: /js/plugins/sites.js
|
|
207
209
|
friendsjs: /js/plugins/friends.js
|
|
@@ -230,6 +232,32 @@ plugins:
|
|
|
230
232
|
interval: 100 # ms
|
|
231
233
|
scale: 1 # 0.1~1
|
|
232
234
|
|
|
235
|
+
# https://fancyapps.com/docs/ui/fancybox/
|
|
236
|
+
# available for {% image xxx %}
|
|
237
|
+
fancybox:
|
|
238
|
+
enable: true
|
|
239
|
+
js: https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js
|
|
240
|
+
css: https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css
|
|
241
|
+
# 可以处理评论区的图片(不支持 iframe 类评论系统)例如:
|
|
242
|
+
# 使用valine评论可以写: .vcontent img:not(.vemoji)
|
|
243
|
+
# 使用twikoo评论可以写: .tk-content img:not([class*="emo"])
|
|
244
|
+
selector: .swiper-slide img # 多个选择器用英文逗号隔开
|
|
245
|
+
|
|
246
|
+
# swiper
|
|
247
|
+
swiper:
|
|
248
|
+
enable: true
|
|
249
|
+
css: https://unpkg.com/swiper@6/swiper-bundle.min.css
|
|
250
|
+
js: https://unpkg.com/swiper@6/swiper-bundle.min.js
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
# 赫蹏 (Heti) - 专为中文网页内容设计的排版样式增强
|
|
254
|
+
# https://github.com/sivan/heti
|
|
255
|
+
heti:
|
|
256
|
+
enable: false
|
|
257
|
+
css: https://unpkg.com/heti/umd/heti.min.css
|
|
258
|
+
js: https://unpkg.com/heti/umd/heti-addon.min.js
|
|
259
|
+
|
|
260
|
+
|
|
233
261
|
style:
|
|
234
262
|
darkmode: auto # auto / always / false
|
|
235
263
|
theme:
|
package/languages/en.yml
CHANGED
package/languages/zh-CN.yml
CHANGED
package/languages/zh-TW.yml
CHANGED
package/layout/404.ejs
CHANGED
|
@@ -16,6 +16,6 @@ page.robots = 'none';
|
|
|
16
16
|
<%- __('page.error.why') %>
|
|
17
17
|
</p>
|
|
18
18
|
<br><br>
|
|
19
|
-
<a class='button theme' id='back' href="
|
|
19
|
+
<a class='button theme' id='back' href="<%- config.root %>"><%- __('page.error.action') %></a>
|
|
20
20
|
</article>
|
|
21
21
|
<%- partial('_partial/plugins/comments/layout') %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<%
|
|
2
|
+
function div() {
|
|
3
|
+
var el = '';
|
|
4
|
+
if (page.banner == undefined || page.banner == false) {
|
|
5
|
+
return el;
|
|
6
|
+
}
|
|
7
|
+
el += '<div class="l_cover post' + scrollreveal() + '">';
|
|
8
|
+
el += '<div class="cover">';
|
|
9
|
+
if (theme.plugins.lazyload && theme.plugins.lazyload.enable) {
|
|
10
|
+
el += '<div class="lazy img bg" data-bg="' + page.banner + '"></div>';
|
|
11
|
+
} else {
|
|
12
|
+
el += '<div class="lazy img bg" style="background-image:url("' + page.banner + '")"></div>';
|
|
13
|
+
}
|
|
14
|
+
el += '</div>';
|
|
15
|
+
el += '</div>';
|
|
16
|
+
return el;
|
|
17
|
+
}
|
|
18
|
+
%>
|
|
19
|
+
<%- div() %>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<%
|
|
2
2
|
function layoutWikiCover() {
|
|
3
3
|
var el = '';
|
|
4
|
-
if (page.layout !== 'wiki') {
|
|
5
|
-
return el;
|
|
6
|
-
}
|
|
7
4
|
let proj = theme.wiki.projects[page.wiki];
|
|
8
5
|
if (proj == undefined) {
|
|
9
6
|
return el;
|
|
@@ -21,7 +18,7 @@ function layoutWikiCover() {
|
|
|
21
18
|
if (cover === true) {
|
|
22
19
|
cover = ['logo', 'title', 'description'];
|
|
23
20
|
}
|
|
24
|
-
el += '<div class="l_cover' + scrollreveal() + '">';
|
|
21
|
+
el += '<div class="l_cover wiki' + scrollreveal() + '">';
|
|
25
22
|
el += '<article class="cover-wrap md">';
|
|
26
23
|
|
|
27
24
|
if (logo && logo.src && cover.includes('logo')) {
|
package/layout/_partial/head.ejs
CHANGED
|
@@ -51,6 +51,7 @@ function og_args() {
|
|
|
51
51
|
<meta http-equiv='x-dns-prefetch-control' content='on' />
|
|
52
52
|
<link rel='dns-prefetch' href='https://cdn.jsdelivr.net'>
|
|
53
53
|
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
|
|
54
|
+
<link rel='dns-prefetch' href='//unpkg.com'>
|
|
54
55
|
|
|
55
56
|
<meta name="renderer" content="webkit">
|
|
56
57
|
<meta name="force-rendering" content="webkit">
|
|
@@ -61,6 +62,15 @@ function og_args() {
|
|
|
61
62
|
<meta name="theme-color" content="#f8f8f8">
|
|
62
63
|
<title><%- generate_title() %></title>
|
|
63
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
|
+
|
|
64
74
|
<% if (theme.open_graph && theme.open_graph.enable) { %>
|
|
65
75
|
<%- open_graph(og_args()) %>
|
|
66
76
|
<% } %>
|
|
@@ -50,12 +50,6 @@ function layoutDiv() {
|
|
|
50
50
|
el += '<span class="note">' + title_prev + '</span>';
|
|
51
51
|
el += '</a>';
|
|
52
52
|
}
|
|
53
|
-
if (page.layout == 'post') {
|
|
54
|
-
el += '<div class="line"></div>';
|
|
55
|
-
el += '<a id="more" href="' + url_for(config.archive_dir) + '">';
|
|
56
|
-
el += __('meta.all_articles');
|
|
57
|
-
el += '</a>';
|
|
58
|
-
}
|
|
59
53
|
el += '</section>';
|
|
60
54
|
el += '</div>';
|
|
61
55
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<%
|
|
2
|
-
function
|
|
2
|
+
function div_default() {
|
|
3
3
|
var el = '';
|
|
4
|
+
el += '<article class="md">';
|
|
5
|
+
|
|
4
6
|
// 封面
|
|
5
7
|
if (post.cover || theme.article.auto_cover) {
|
|
6
8
|
var cover_url;
|
|
@@ -38,7 +40,11 @@ function layoutDiv() {
|
|
|
38
40
|
el += '</h2>';
|
|
39
41
|
|
|
40
42
|
// 摘要
|
|
41
|
-
el += '<div class="excerpt
|
|
43
|
+
el += '<div class="excerpt';
|
|
44
|
+
if (theme.plugins.heti && theme.plugins.heti.enable) {
|
|
45
|
+
el += ' heti';
|
|
46
|
+
}
|
|
47
|
+
el += '">';
|
|
42
48
|
el += '<p>';
|
|
43
49
|
if (post.excerpt) {
|
|
44
50
|
el += strip_html(post.excerpt);
|
|
@@ -76,9 +82,41 @@ function layoutDiv() {
|
|
|
76
82
|
if (post.pin) {
|
|
77
83
|
el += '<span class="pin"><img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/badge/3279dd441df8b.svg"/></span>';
|
|
78
84
|
}
|
|
79
|
-
el += '
|
|
85
|
+
el += '</div>';
|
|
86
|
+
el += '</article>';
|
|
87
|
+
return el;
|
|
88
|
+
}
|
|
89
|
+
function div_photo() {
|
|
90
|
+
var el = '';
|
|
91
|
+
el += '<div class="cover">';
|
|
92
|
+
el += '<img src="' + post.cover + '"/>';
|
|
93
|
+
if (post.cover_info) {
|
|
94
|
+
el += '<div class="cover-info"';
|
|
95
|
+
if (post.cover_info.meta) {
|
|
96
|
+
el += 'position="top">';
|
|
97
|
+
} else {
|
|
98
|
+
el += 'position="bottom">';
|
|
99
|
+
}
|
|
100
|
+
if (post.cover_info.meta) {
|
|
101
|
+
el += '<div class="cap">' + post.cover_info.meta + '</div>';
|
|
102
|
+
}
|
|
103
|
+
if (post.cover_info.title) {
|
|
104
|
+
el += '<div class="title">' + post.cover_info.title + '</div>';
|
|
105
|
+
}
|
|
106
|
+
if (post.cover_info.subtitle) {
|
|
107
|
+
el += '<div class="cap">' + post.cover_info.subtitle + '</div>';
|
|
108
|
+
}
|
|
109
|
+
el += '</div>';
|
|
80
110
|
|
|
111
|
+
}
|
|
112
|
+
el += '</div>';
|
|
81
113
|
return el;
|
|
82
114
|
}
|
|
115
|
+
function div() {
|
|
116
|
+
if (post.cover && post.cover.length > 0 && post.cover_info != undefined) {
|
|
117
|
+
return div_photo();
|
|
118
|
+
}
|
|
119
|
+
return div_default();
|
|
120
|
+
}
|
|
83
121
|
%>
|
|
84
|
-
<%-
|
|
122
|
+
<%- div() %>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<%
|
|
2
2
|
function layoutDiv() {
|
|
3
3
|
var el = '';
|
|
4
|
+
el += '<article class="md">';
|
|
4
5
|
if (proj.logo && proj.logo.src) {
|
|
5
6
|
el += '<div class="preview">';
|
|
6
7
|
el += '<img src="' + proj.logo.src + '" alt="logo"';
|
|
@@ -20,6 +21,7 @@ function layoutDiv() {
|
|
|
20
21
|
el += '<p>' + proj.description + '</p>';
|
|
21
22
|
}
|
|
22
23
|
el += '</div>';
|
|
24
|
+
el += '</article>';
|
|
23
25
|
return el;
|
|
24
26
|
}
|
|
25
27
|
%>
|
|
@@ -121,6 +121,12 @@
|
|
|
121
121
|
if ('<%- theme.plugins.preload.enable %>' == 'true') {
|
|
122
122
|
stellar.plugins.preload = Object.assign(<%- JSON.stringify(theme.plugins.preload) %>);
|
|
123
123
|
}
|
|
124
|
+
if ('<%- theme.plugins.fancybox.enable %>' == 'true') {
|
|
125
|
+
stellar.plugins.fancybox = Object.assign(<%- JSON.stringify(theme.plugins.fancybox) %>);
|
|
126
|
+
}
|
|
127
|
+
if ('<%- theme.plugins.heti.enable %>' == 'true') {
|
|
128
|
+
stellar.plugins.heti = Object.assign(<%- JSON.stringify(theme.plugins.heti) %>);
|
|
129
|
+
}
|
|
124
130
|
</script>
|
|
125
131
|
|
|
126
132
|
<!-- required -->
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
// 默认组件
|
|
3
3
|
if (page.sidebar == undefined) {
|
|
4
4
|
if (page.layout == 'post' && page.content) {
|
|
5
|
-
page.sidebar =
|
|
5
|
+
page.sidebar = theme.sidebar.widget_layout.post;
|
|
6
6
|
} else if (page.layout == 'wiki' && page.content && page.wiki) {
|
|
7
7
|
let proj = theme.wiki.projects[page.wiki];
|
|
8
8
|
if (proj.sidebar) {
|
|
9
9
|
page.sidebar = proj.sidebar;
|
|
10
10
|
} else {
|
|
11
|
-
page.sidebar =
|
|
11
|
+
page.sidebar = theme.sidebar.widget_layout.wiki;
|
|
12
12
|
}
|
|
13
|
+
} else if (is_home() || ['categories', 'tags', 'archives', 'index', '404', undefined].includes(page.layout)) {
|
|
14
|
+
page.sidebar = theme.sidebar.widget_layout.index;
|
|
15
|
+
} else if (page.layout == 'page') {
|
|
16
|
+
page.sidebar = theme.sidebar.widget_layout.page;
|
|
13
17
|
} else {
|
|
14
|
-
page.sidebar =
|
|
18
|
+
page.sidebar = [];
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
function layoutWidgets() {
|
|
@@ -31,10 +35,11 @@ function layoutWidgets() {
|
|
|
31
35
|
return el;
|
|
32
36
|
}
|
|
33
37
|
function layoutFooterDiv() {
|
|
34
|
-
if (page.layout !== 'wiki' && theme.footer.social
|
|
38
|
+
if (page.layout !== 'wiki' && theme.footer.social) {
|
|
35
39
|
var el = '<footer class="footer dis-select">';
|
|
36
40
|
el += '<div class="social-wrap">';
|
|
37
|
-
theme.footer.social
|
|
41
|
+
for (let id of Object.keys(theme.footer.social)) {
|
|
42
|
+
let item = theme.footer.social[id];
|
|
38
43
|
if (item.icon && (item.url || item.onclick)) {
|
|
39
44
|
el += '<a class="social"';
|
|
40
45
|
if (item.title) {
|
|
@@ -55,7 +60,7 @@ function layoutFooterDiv() {
|
|
|
55
60
|
el += item.icon;
|
|
56
61
|
el += '</a>';
|
|
57
62
|
}
|
|
58
|
-
}
|
|
63
|
+
}
|
|
59
64
|
el += '</div>';
|
|
60
65
|
el += '</footer>';
|
|
61
66
|
return el;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</div>
|
|
1
|
+
<%
|
|
2
|
+
function layoutDiv() {
|
|
3
|
+
var el = '';
|
|
4
|
+
if (item.content == undefined || item.content.length == 0) {
|
|
5
|
+
return el;
|
|
6
|
+
}
|
|
7
|
+
el += '<div class="widget-wrap" id="markdown">';
|
|
8
|
+
el += '<div class="widget-header cap dis-select">';
|
|
9
|
+
el += '<span class="name">' + item.title + '</span>';
|
|
10
|
+
el += '</div>';
|
|
11
|
+
el += '<div class="widget-body fs14">';
|
|
12
|
+
el += markdown(item.content);
|
|
13
|
+
el += '</div>';
|
|
14
|
+
el += '</div>';
|
|
15
|
+
return el;
|
|
16
|
+
}
|
|
17
|
+
%>
|
|
18
|
+
<%- layoutDiv() %>
|
|
@@ -27,29 +27,21 @@ function layoutDiv() {
|
|
|
27
27
|
}
|
|
28
28
|
el += '<div class="widget-body fs14">';
|
|
29
29
|
arr.sort("updated", -1).limit(item.limit).each(function(post) {
|
|
30
|
-
el += '<div class="
|
|
31
|
-
el += '<a class="
|
|
32
|
-
el += '<div class="cap">';
|
|
33
|
-
el += '<time>' + date(post.updated, config.date_format) + '</time>';
|
|
30
|
+
el += '<div class="more-item">';
|
|
31
|
+
el += '<a class="title" href="' + url_for(post.link || post.path) + '">';
|
|
34
32
|
if (post.layout == 'wiki') {
|
|
35
33
|
el += '<span>';
|
|
36
34
|
let proj = theme.wiki.projects[post.wiki];
|
|
37
35
|
if (proj && proj.title) {
|
|
38
|
-
el += proj.title;
|
|
36
|
+
el += proj.title + __('symbol.colon');
|
|
39
37
|
} else if (post.wiki) {
|
|
40
|
-
el += post.wiki;
|
|
38
|
+
el += post.wiki + __('symbol.colon');
|
|
41
39
|
}
|
|
42
40
|
el += '</span>';
|
|
43
|
-
} else {
|
|
44
|
-
post.categories.limit(1).forEach((cat, i) => {
|
|
45
|
-
el += '<span>' + cat.name + '</span>';
|
|
46
|
-
});
|
|
47
41
|
}
|
|
48
|
-
el += '</div>';
|
|
49
|
-
el += '<span class="title">';
|
|
50
42
|
el += post.title || post.seo_title || post.wiki;
|
|
51
|
-
el += '</span>';
|
|
52
43
|
el += '</a>';
|
|
44
|
+
el += '</div>';
|
|
53
45
|
el += '';
|
|
54
46
|
});
|
|
55
47
|
el += '</div>';
|
|
@@ -66,7 +66,7 @@ function layoutDiv(fallback) {
|
|
|
66
66
|
el += '<div class="widget-wrap ' + type + '" id="toc">';
|
|
67
67
|
if (page.layout !== 'wiki') {
|
|
68
68
|
// post 布局
|
|
69
|
-
el += layoutTocHeader(page.toc_title
|
|
69
|
+
el += layoutTocHeader(page.toc_title);
|
|
70
70
|
el += '<div class="widget-body fs14">';
|
|
71
71
|
el += '<div class="doc-tree active">';
|
|
72
72
|
el += layoutToc();
|
|
@@ -84,6 +84,7 @@ function layoutDiv(fallback) {
|
|
|
84
84
|
});
|
|
85
85
|
} else {
|
|
86
86
|
// 单 section
|
|
87
|
+
el += layoutTocHeader(page.toc_title);
|
|
87
88
|
el += '<div class="widget-body fs14">';
|
|
88
89
|
el += layoutDocTree(proj.pages);
|
|
89
90
|
el += '</div>';
|
package/layout/archive.ejs
CHANGED
|
@@ -18,13 +18,13 @@ if (page.menu_id == undefined) {
|
|
|
18
18
|
<% } %>
|
|
19
19
|
<% }); %>
|
|
20
20
|
<% years.forEach((year, i) => { %>
|
|
21
|
-
<article class='
|
|
22
|
-
<div class='archive-
|
|
21
|
+
<article class='<%- scrollreveal() %>' id='archive'>
|
|
22
|
+
<div class='archive-header h4'><%= year %></div>
|
|
23
23
|
<% site.posts.sort('date', -1).filter(function (post) { %>
|
|
24
24
|
<% post.year = date(post.date, 'YYYY'); %>
|
|
25
25
|
<% return post.year == year; %>
|
|
26
26
|
<% }).each(function(post) { %>
|
|
27
|
-
<div>
|
|
27
|
+
<div class='archive-list'>
|
|
28
28
|
<a class='post fs14' href="<%= url_for(post.link || post.path) %>">
|
|
29
29
|
<time><%= date(post.date, 'MM-DD') %></time>
|
|
30
30
|
<span>
|
package/layout/categories.ejs
CHANGED
|
@@ -9,7 +9,7 @@ if (page.menu_id == undefined) {
|
|
|
9
9
|
<% page.layout = 'categories'; %>
|
|
10
10
|
<%- partial('_partial/main/navbar/list_post') %>
|
|
11
11
|
<div class='post-list'>
|
|
12
|
-
<article class='
|
|
12
|
+
<article class='<%- scrollreveal() %>' id='cats'>
|
|
13
13
|
<% site.categories.sort('path').each(function(category){ %>
|
|
14
14
|
<div>
|
|
15
15
|
<a class="<%= category.parent ? 'cat child' : 'cat'%>" href="<%= url_for(category.path) %>">
|
package/layout/index.ejs
CHANGED
|
@@ -12,10 +12,13 @@ if (page.title && page.wiki) {
|
|
|
12
12
|
|
|
13
13
|
function layout_post_card(layout, post, content) {
|
|
14
14
|
var el = '';
|
|
15
|
+
var layout = layout;
|
|
16
|
+
if (layout == 'post' && post.cover != undefined && post.cover_info != undefined) {
|
|
17
|
+
layout += ' photo';
|
|
18
|
+
}
|
|
15
19
|
el += '<a class="post-card ' + layout + ' ' + scrollreveal() + '" href="' + url_for(post.link || post.path) + '">';
|
|
16
|
-
el += '<article class="md">';
|
|
17
20
|
el += content;
|
|
18
|
-
el += '</
|
|
21
|
+
el += '</a>';
|
|
19
22
|
return el;
|
|
20
23
|
}
|
|
21
24
|
|
package/layout/layout.ejs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html lang='<%- page.lang %>'>
|
|
3
3
|
<%- partial('_partial/head') %>
|
|
4
4
|
<body>
|
|
5
|
-
<%- partial('_partial/
|
|
5
|
+
<%- partial('_partial/cover/index') %>
|
|
6
6
|
<div class='l_body' id='start'>
|
|
7
7
|
<aside class='l_left' layout='<%- page.layout %>'>
|
|
8
8
|
<%- partial('_partial/sidebar/index') %>
|
package/layout/post.ejs
CHANGED
|
@@ -13,10 +13,14 @@ function layoutTitle() {
|
|
|
13
13
|
return '';
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
let post = page;
|
|
17
|
+
let heti = '';
|
|
18
|
+
if (theme.plugins.heti && theme.plugins.heti.enable) {
|
|
19
|
+
heti = ' heti';
|
|
20
|
+
}
|
|
16
21
|
%>
|
|
17
|
-
<% let post = page; %>
|
|
18
22
|
<%- partial('_partial/main/navbar/breadcrumb') %>
|
|
19
|
-
<article class='content md <%- post.layout %><%- scrollreveal() %>'>
|
|
23
|
+
<article class='content<%- heti %> md <%- post.layout %><%- post.indent ? ' indent' : '' %><%- scrollreveal() %>'>
|
|
20
24
|
<%- layoutTitle() %>
|
|
21
25
|
<%- post.content %>
|
|
22
26
|
<%- partial('_partial/main/article/article_footer') %>
|
package/layout/tags.ejs
CHANGED
|
@@ -9,7 +9,7 @@ if (page.menu_id == undefined) {
|
|
|
9
9
|
<% page.layout = 'tags'; %>
|
|
10
10
|
<%- partial('_partial/main/navbar/list_post') %>
|
|
11
11
|
<div class='post-list'>
|
|
12
|
-
<article class='
|
|
12
|
+
<article class='<%- scrollreveal() %>' id='tags'>
|
|
13
13
|
<% site.tags.sort('length', -1).each(function(tag){ %>
|
|
14
14
|
<a class='tag' href="<%= url_for(tag.path) %>">
|
|
15
15
|
<span class='name'><%= tag.name %></span>
|
package/package.json
CHANGED
package/scripts/events/index.js
CHANGED
|
@@ -10,11 +10,9 @@ hexo.on('generateBefore', () => {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
hexo.on('ready', () => {
|
|
13
|
-
const { version } = require('../../package.json');
|
|
14
|
-
hexo.log.info(`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Repo: https://github.com/xaoxuu/hexo-theme-stellar/
|
|
19
|
-
=======================================================`);
|
|
13
|
+
const { version, homepage, repository } = require('../../package.json');
|
|
14
|
+
hexo.log.info(`Welcome to Stellar ${version}
|
|
15
|
+
DOCS ${homepage}
|
|
16
|
+
REPO ${repository.url}
|
|
17
|
+
`);
|
|
20
18
|
});
|