hexo-theme-solitude 1.5.10 → 1.6.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/.github/logo.svg +44 -10
- package/README.md +22 -2
- package/README_zh-cn.md +22 -2
- package/README_zh-tw.md +22 -2
- package/_config.yml +89 -73
- package/layout/includes/footer.pug +1 -1
- package/layout/includes/inject/head.pug +1 -2
- package/layout/includes/loading.pug +1 -1
- package/layout/includes/widgets/home/banner.pug +1 -1
- package/layout/includes/widgets/home/categoryGroup.pug +0 -1
- package/layout/includes/widgets/home/postList.pug +74 -29
- package/layout/includes/widgets/nav/group.pug +1 -1
- package/layout/page.pug +1 -1
- package/package.json +1 -1
- package/plugins.yml +0 -4
- package/scripts/event/cdn.js +4 -4
- package/scripts/event/merge_config.js +211 -0
- package/scripts/event/welcome.js +2 -2
- package/scripts/filter/checkThemeConfig.js +2 -2
- package/scripts/filter/default.js +7 -5
- package/scripts/filter/lazyload.js +18 -5
- package/scripts/filter/randomPosts.js +1 -1
- package/scripts/helper/stylus.js +9 -15
- package/source/css/_global/index.styl +362 -1
- package/source/css/_highlight/color.styl +111 -45
- package/source/css/_highlight/prismjs/diff.styl +80 -184
- package/source/css/_highlight/prismjs/index.styl +2 -0
- package/source/css/_highlight/prismjs/line-number.styl +0 -3
- package/source/css/_layout/aside.styl +751 -0
- package/source/css/_layout/capsule.styl +213 -0
- package/source/css/_layout/fullpage.styl +47 -0
- package/source/css/_layout/keyboard.styl +60 -0
- package/source/css/_layout/pace.styl +40 -0
- package/source/css/_layout/rightmenu.styl +79 -0
- package/source/css/_layout/universe.styl +18 -0
- package/source/css/_page/_home/home-top.styl +1 -3
- package/source/css/_page/_home/recent-post.styl +407 -170
- package/source/css/_page/douban.styl +111 -109
- package/source/css/_page/share.styl +1 -17
- package/source/css/{_widgets/_post → _post}/content.styl +0 -3
- package/source/css/index.styl +20 -5
- package/source/css/third_party/snackbar.min.css +1 -0
- package/source/css/{_global/var.styl → var.styl} +11 -7
- package/source/img/avatar.png +0 -0
- package/source/img/default.png +0 -0
- package/source/img/happy-sticker.png +0 -0
- package/source/img/pwa/favicon.ico +0 -0
- package/source/img/pwa/favicon_128.ico +0 -0
- package/source/img/pwa/favicon_16.ico +0 -0
- package/source/img/pwa/favicon_256.ico +0 -0
- package/source/img/pwa/favicon_32.ico +0 -0
- package/source/js/main.js +1 -0
- package/layout/includes/recent-posts.pug +0 -9
- package/source/css/_layout/basic.styl +0 -308
- package/source/css/_layout/index.styl +0 -125
- package/source/css/_widgets/_aside/allinfo.styl +0 -168
- package/source/css/_widgets/_aside/flip.styl +0 -67
- package/source/css/_widgets/_aside/index.styl +0 -90
- package/source/css/_widgets/_aside/info.styl +0 -263
- package/source/css/_widgets/_aside/newPost.styl +0 -61
- package/source/css/_widgets/_aside/toc.styl +0 -108
- package/source/css/_widgets/_aside/welcome.styl +0 -14
- package/source/css/_widgets/_extra/fullpage.styl +0 -46
- package/source/css/_widgets/_extra/music.styl +0 -218
- package/source/css/_widgets/_extra/pace.styl +0 -39
- package/source/css/_widgets/_extra/rightmenu.styl +0 -78
- package/source/css/_widgets/_mixins/keyboard.styl +0 -59
- package/source/css/_widgets/index.styl +0 -56
- package/source/img/logo.png +0 -0
- /package/source/css/{_widgets/_comment → _comments}/index.styl +0 -0
- /package/source/css/{_widgets/_comment → _comments}/twikoo.styl +0 -0
- /package/source/css/{_widgets/_comment → _comments}/waline.styl +0 -0
- /package/source/css/{_widgets/_mixins → _layout}/article-sort.styl +0 -0
- /package/source/css/{_widgets/_extra → _layout}/console.styl +0 -0
- /package/source/css/{_widgets/_mixins → _layout}/footer.styl +0 -0
- /package/source/css/{_widgets/_mixins → _layout}/other.styl +0 -0
- /package/source/css/{_widgets/_mixins → _layout}/sidebar.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/commentBarrage.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/copyright.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/index.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/meta.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/pagination.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/postAI.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/relatedPost.styl +0 -0
- /package/source/css/{_widgets/_post → _post}/tools.styl +0 -0
- /package/source/css/{_widgets/_search → _search}/algolia-search.styl +0 -0
- /package/source/css/{_widgets/_search → _search}/local-search.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/button.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/checkbox.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/fold.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/gallery.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/index.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/label.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/link.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/media.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/mermaid.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/note.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/span.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/tabs.styl +0 -0
- /package/source/css/{_widgets/_tags → _tags}/timeline.styl +0 -0
- /package/source/js/{lately.min.js → third_party/lately.min.js} +0 -0
- /package/source/js/{sco-ai.min.js → third_party/sco-ai.min.js} +0 -0
- /package/source/js/{universe.min.js → third_party/universe.min.js} +0 -0
- /package/source/js/{waterfall.min.js → third_party/waterfall.min.js} +0 -0
package/layout/page.pug
CHANGED
package/package.json
CHANGED
package/plugins.yml
CHANGED
package/scripts/event/cdn.js
CHANGED
@@ -61,7 +61,7 @@ hexo.extend.filter.register('before_generate', () => {
|
|
61
61
|
},
|
62
62
|
sco_ai_js: {
|
63
63
|
name: 'hexo-theme-solitude',
|
64
|
-
file: 'js/sco-ai.min.js',
|
64
|
+
file: 'js/third_party/sco-ai.min.js',
|
65
65
|
version
|
66
66
|
},
|
67
67
|
twikoo_commentBarrage: {
|
@@ -76,17 +76,17 @@ hexo.extend.filter.register('before_generate', () => {
|
|
76
76
|
},
|
77
77
|
waterfall: {
|
78
78
|
name: 'hexo-theme-solitude',
|
79
|
-
file: 'js/waterfall.min.js',
|
79
|
+
file: 'js/third_party/waterfall.min.js',
|
80
80
|
version
|
81
81
|
},
|
82
82
|
universe_js: {
|
83
83
|
name: 'hexo-theme-solitude',
|
84
|
-
file: 'js/universe.min.js',
|
84
|
+
file: 'js/third_party/universe.min.js',
|
85
85
|
version
|
86
86
|
},
|
87
87
|
lately_js: {
|
88
88
|
name: 'hexo-theme-solitude',
|
89
|
-
file: 'js/lately.min.js',
|
89
|
+
file: 'js/third_party/lately.min.js',
|
90
90
|
version
|
91
91
|
},
|
92
92
|
}
|
@@ -0,0 +1,211 @@
|
|
1
|
+
hexo.extend.filter.register('before_generate', () => {
|
2
|
+
const defaultConfig = {
|
3
|
+
site: {
|
4
|
+
name: {
|
5
|
+
class: 'text', custom: 'Solitude'
|
6
|
+
}, siteIcon: '/img/logo.png', icon: 'icon'
|
7
|
+
}, nav: {
|
8
|
+
group: null, menu: null, right: {
|
9
|
+
random: false, console: false, custom: [],
|
10
|
+
}
|
11
|
+
}, hometop: {
|
12
|
+
enable: false, banner: {
|
13
|
+
title: 'Solitude', url: 'A simple theme for Hexo', icon: null,
|
14
|
+
}, group: null, recommendList: {
|
15
|
+
sup: 'Recommend',
|
16
|
+
title: 'Solitude Docs',
|
17
|
+
url: 'https://solitude-docs.efu.me/',
|
18
|
+
img: '/img/default.png',
|
19
|
+
color: 'none',
|
20
|
+
}
|
21
|
+
}, aside: {
|
22
|
+
home: {
|
23
|
+
noSticky: 'about', Sticky: 'allInfo'
|
24
|
+
}, post: {
|
25
|
+
noSticky: 'about', Sticky: 'allInfo'
|
26
|
+
}, page: {
|
27
|
+
noSticky: 'about', Sticky: 'allInfo'
|
28
|
+
}, card: {
|
29
|
+
author: {
|
30
|
+
img: '/img/logo.png', sticker: '/img/happy-sticker.png',
|
31
|
+
},
|
32
|
+
url: '/about/',
|
33
|
+
content1: 'Solitude',
|
34
|
+
content2: 'A simple theme for Hexo',
|
35
|
+
sayhello: {
|
36
|
+
morning: 'Good Morning',
|
37
|
+
noon: 'Good Noon',
|
38
|
+
afternoon: 'Good Afternoon',
|
39
|
+
night: 'Good Night',
|
40
|
+
goodnight: 'Good Night',
|
41
|
+
},
|
42
|
+
sayhello2: ['Welcome to Solitude', 'A simple theme for Hexo', 'Enjoy your time', 'Have a nice day', 'Good luck'],
|
43
|
+
information: null,
|
44
|
+
}, flip: {
|
45
|
+
favicon: '', face: '', backface: '', backcolor: 'var(--efu-blue)'
|
46
|
+
}, toc: {
|
47
|
+
post: true, page: false, vague: true,
|
48
|
+
}, tags: {
|
49
|
+
enable: true, limit: 20, highlight: false, list: [],
|
50
|
+
}, archive: {
|
51
|
+
enable: true, type: 'month'
|
52
|
+
}, siteinfo: {
|
53
|
+
postcount: true,
|
54
|
+
wordcount: false,
|
55
|
+
pv: true,
|
56
|
+
uv: true,
|
57
|
+
updatetime: true,
|
58
|
+
runtimeenable: true,
|
59
|
+
runtime: "2023-04-20 00:00:00",
|
60
|
+
},
|
61
|
+
}, index_post_list: {
|
62
|
+
direction: 'column', content: false, length: 500, cover: 'both'
|
63
|
+
}, page: {
|
64
|
+
error: true, tags: true, categories: true, default: {
|
65
|
+
cover: ['/img/default.png'],
|
66
|
+
}
|
67
|
+
}, post: {
|
68
|
+
default: {
|
69
|
+
cover: ['/img/default.png'], locate: 'China, Changsha', copyright: {
|
70
|
+
enable: true,
|
71
|
+
license: 'CC BY-NC-SA 4.0',
|
72
|
+
licenurl: 'https://creativecommons.org/licenses/by-nc-sa/4.0/',
|
73
|
+
}
|
74
|
+
}, meta: {
|
75
|
+
date: false,
|
76
|
+
updated: false,
|
77
|
+
locate: false,
|
78
|
+
wordcount: false,
|
79
|
+
readtime: false,
|
80
|
+
pv: false,
|
81
|
+
uv: false,
|
82
|
+
comment: false,
|
83
|
+
}, award: {
|
84
|
+
enable: false,
|
85
|
+
wechat: 'https://7.isyangs.cn/34/65f2e5814db1a-34.png',
|
86
|
+
alipay: 'https://7.isyangs.cn/34/65f2e5a6d2ef5-34.png',
|
87
|
+
url: '/about/',
|
88
|
+
}, rss: null, covercolor: {
|
89
|
+
enable: false, mode: 'local', api: 'https://api.qjqq.cn/api/Imgcolor?img=', time: 43200000,
|
90
|
+
}
|
91
|
+
}, theme_color: {
|
92
|
+
dark: "#ffc848",
|
93
|
+
dark_op: "#f2b94b23",
|
94
|
+
dark_op_deep: "#f2b94bdd",
|
95
|
+
dark_none: "#f2b94b00",
|
96
|
+
light: "#425AEF",
|
97
|
+
light_op: "#4259ef23",
|
98
|
+
light_op_deep: "#4259efdd",
|
99
|
+
light_none: "#4259ef01"
|
100
|
+
}, display_mode: {
|
101
|
+
type: 'auto', universe: false
|
102
|
+
}, related_post: {
|
103
|
+
enable: false, limit: 2, date_type: 'created'
|
104
|
+
}, footer: {
|
105
|
+
information: {
|
106
|
+
left: null, right: null,
|
107
|
+
}, group: null, randomlink: false, privacy: null, license: null, links: [{
|
108
|
+
name: 'Solitude', url: 'https://github.com/valor-x/hexo-theme-solitude',
|
109
|
+
}]
|
110
|
+
}, errorpage: {
|
111
|
+
img: 'https://7.isyangs.cn/34/65f2e65eae32a-34.png', text: '404 Not Found', recommendList: true
|
112
|
+
}, says: {
|
113
|
+
enable: false, home_mini: false, style: 1, strip: 30
|
114
|
+
}, meting_api: "https://meting.qjqq.cn/?server=:server&type=:type&id=:id&auth=:auth&r=:r", music: {
|
115
|
+
enable: false, id: '8407304077', server: 'netease', type: 'playlist', volume: 0.8, mutex: true,
|
116
|
+
}, capsule: {
|
117
|
+
enable: false, id: '8407304077', server: 'netease', type: 'playlist',
|
118
|
+
}, moments: {
|
119
|
+
enable: false,
|
120
|
+
api: '',
|
121
|
+
error_img: '/img/logo.png',
|
122
|
+
sort_rule: 'created',
|
123
|
+
expire_days: 1,
|
124
|
+
page_init_number: 10,
|
125
|
+
page_turning_number: 5,
|
126
|
+
angle: false,
|
127
|
+
appjs: 'https://cdn.cbd.int/st-source@1.0.3/js/fcircle.min.js',
|
128
|
+
bundlejs: 'https://cdn.cbd.int/st-source/js/moment/bundle.min.js',
|
129
|
+
randompostjs: 'https://cdn.cbd.int/st-source/js/moment/random_post.min.js'
|
130
|
+
}, keyboard: {
|
131
|
+
enable: false, list: []
|
132
|
+
}, lazyload: {
|
133
|
+
enable: false, field: 'site', placeholder: '/img/loading.gif', errorimg: '/img/error_load.png'
|
134
|
+
}, loading: {
|
135
|
+
fullpage: false, pace: true,
|
136
|
+
}, highlight: {
|
137
|
+
enable: true, limit: 200, copy: true, expand: true, theme: 'default', color: 'default',
|
138
|
+
}, lightbox: false, fancybox: false, mediumZoom: false, mermaid: false, translate: {
|
139
|
+
enable: false, defaultEncoding: 2, translateDelay: 0,
|
140
|
+
}, opengraph: {
|
141
|
+
enable: false, options: null
|
142
|
+
}, wordcount: false, busuanzi: false, search: {
|
143
|
+
enable: false, type: 'local', tags: [], algolia: null, local: {
|
144
|
+
preload: false, CDN: null,
|
145
|
+
}
|
146
|
+
}, rightside: {
|
147
|
+
enable: false
|
148
|
+
}, post_ai: {
|
149
|
+
enable: false,
|
150
|
+
modelName: 'GPT 3',
|
151
|
+
key: 'your key',
|
152
|
+
talk: 'I am a AI.',
|
153
|
+
randomPost: false,
|
154
|
+
tips: 'AI is not perfect, please use it with caution.'
|
155
|
+
}, katex: {
|
156
|
+
enable: false, per_page: false, copytex: false,
|
157
|
+
}, comment: {
|
158
|
+
enable: false,
|
159
|
+
type: 'twikoo',
|
160
|
+
commentBarrage: false,
|
161
|
+
newComment: false,
|
162
|
+
randomInfoStart: [`baby's`, `little`, `my`,],
|
163
|
+
randomInfoEnd: [`home`, `world`, `heart`,],
|
164
|
+
twikoo: {
|
165
|
+
envId: 'your envId', lang: 'zh-CN', accessToken: null,
|
166
|
+
},
|
167
|
+
waline: {
|
168
|
+
envId: 'your envId', pageview: true, option: null,
|
169
|
+
},
|
170
|
+
verify_site: [],
|
171
|
+
css_prefix: false,
|
172
|
+
font: {
|
173
|
+
'font-size': '16px',
|
174
|
+
'code-font-size': '16px',
|
175
|
+
'font-family': '"PingFang SC","Hiragino Sans GB","Microsoft YaHei"',
|
176
|
+
'code-font-family': '"monospace", "monospace"',
|
177
|
+
},
|
178
|
+
extends: {
|
179
|
+
head: [], body: [],
|
180
|
+
},
|
181
|
+
pwa: {
|
182
|
+
enable: false,
|
183
|
+
manifest: '/manifest.json',
|
184
|
+
theme_color: "#006a73",
|
185
|
+
mask_icon: '/img/logo.png',
|
186
|
+
apple_touch_icon: '/img/logo.png',
|
187
|
+
bookmark_icon: '/img/logo.png',
|
188
|
+
favicon_32_32: '/img/logo.png',
|
189
|
+
favicon_16_16: '/img/logo.png'
|
190
|
+
},
|
191
|
+
google_adsense: {
|
192
|
+
enable: false,
|
193
|
+
auto_ads: false,
|
194
|
+
enable_page_level_ads: true,
|
195
|
+
js: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
|
196
|
+
client: '',
|
197
|
+
slot: '',
|
198
|
+
},
|
199
|
+
CDN: {
|
200
|
+
internal: 'local',
|
201
|
+
third_party: 'cdnjs',
|
202
|
+
version: true,
|
203
|
+
custom_format: 'https://cdn.staticfile.net/${cdnjs_name}/${version}/${min_cdnjs_file}',
|
204
|
+
option: {
|
205
|
+
solitude_css: 'https://cdn2.codesign.qq.com/icons/7pOrz0WXB5ZWJPX/latest/iconfont.css',
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
hexo.theme.config = Object.assign(defaultConfig, hexo.theme.config)
|
211
|
+
}, 1)
|
package/scripts/event/welcome.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
hexo.on('ready', () => {
|
2
|
-
|
3
|
-
|
2
|
+
const {version} = require('../../package.json')
|
3
|
+
hexo.log.info(`
|
4
4
|
===================================================================
|
5
5
|
##### #### # ##### ###### # # ###### ######
|
6
6
|
# # # # # # # # # # #
|
@@ -4,12 +4,12 @@ hexo.extend.filter.register('before_post_render', () => {
|
|
4
4
|
const data = hexo.locals.get('data');
|
5
5
|
const logger = hexo.log;
|
6
6
|
const theme = hexo.theme.config;
|
7
|
-
if (theme.hometop.
|
7
|
+
if (theme.hometop.enable && !theme.hometop.banner.icon) {
|
8
8
|
logger.error('\n 启用banner的情况下,必须提供 icon 图片!\n 请在主题配置文件中设置 hometop.banner.icon 选项。');
|
9
9
|
logger.error('\n If banner is enabled, icon image must be supplied! \n Please set the hometop.banner.icon option in the theme configuration file.');
|
10
10
|
process.exit(-1);
|
11
11
|
}
|
12
|
-
if (theme.says.enable &&
|
12
|
+
if (theme.says.enable && !data.essay) {
|
13
13
|
logger.error('\n 启用说说的情况下,必须提供 essay 数据文件!\n 请新建 essay.yaml。');
|
14
14
|
logger.error('\n If says is enabled, essay data must be supplied! \n Please create essay.yaml.');
|
15
15
|
process.exit(-1);
|
@@ -2,18 +2,20 @@
|
|
2
2
|
|
3
3
|
hexo.extend.filter.register('after_post_render', function (data) {
|
4
4
|
data.title = data.title || 'Untitled';
|
5
|
-
const {
|
5
|
+
const {config} = hexo.theme;
|
6
6
|
if (data.layout === 'post') {
|
7
|
-
|
7
|
+
let {copyright, locate, cover} = hexo.theme.config.post.default
|
8
|
+
cover = cover !== null ? cover : ['/img/default.png']
|
8
9
|
data.locate = data.locate || locate
|
9
10
|
data.cc = data.cc || copyright
|
10
|
-
data.cover = data.cover || cover
|
11
|
+
data.cover = data.cover || cover[getRandomInt(0, cover?.length)]
|
11
12
|
data.excerpt = data.description || data.excerpt
|
12
13
|
data.toc = !!(config.aside.toc.post && data.toc !== false);
|
13
14
|
}
|
14
15
|
if (data.layout === 'page') {
|
15
|
-
|
16
|
-
|
16
|
+
let {cover} = hexo.theme.config.page.default
|
17
|
+
cover = cover !== null ? cover : ['/img/default.png']
|
18
|
+
data.cover = data.cover || cover[getRandomInt(0, cover?.length)]
|
17
19
|
data.excerpt = data.title
|
18
20
|
data.toc = !!(config.aside.toc.page && data.toc !== false && data.aside);
|
19
21
|
}
|
@@ -1,7 +1,20 @@
|
|
1
|
+
'use strict'
|
2
|
+
|
3
|
+
const urlFor = require('hexo-util').url_for.bind(hexo)
|
4
|
+
|
5
|
+
const lazyload = (content, img) => {
|
6
|
+
return content.replace(/(<img(?!.*?class[\t]*=[\t]*['"].*?nolazyload.*?['"]).*? src=)/gi, `$1 "${img}" data-lazy-src=`)
|
7
|
+
}
|
8
|
+
|
1
9
|
hexo.extend.filter.register('after_render:html', function (data) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
10
|
+
const { enable, placeholder ,field } = hexo.theme.config.lazyload
|
11
|
+
if (!enable || field !== 'site') return;
|
12
|
+
return lazyload(data, urlFor(placeholder))
|
13
|
+
})
|
14
|
+
|
15
|
+
hexo.extend.filter.register('after_post_render', data => {
|
16
|
+
const { enable, placeholder, field } = hexo.theme.config.lazyload
|
17
|
+
if (!enable || field !== 'post') return
|
18
|
+
data.content = lazyload(data.content, urlFor(placeholder))
|
19
|
+
return data
|
7
20
|
})
|
@@ -1,5 +1,5 @@
|
|
1
1
|
hexo.extend.filter.register('after_render:html', function (data) {
|
2
2
|
const posts = hexo.locals.get('posts').filter(post => post.random !== false).map(post => post.path);
|
3
|
-
data += `<script>const posts=${JSON.stringify(posts)};function toRandomPost(){ pjax.loadUrl('/'+posts[Math.floor(Math.random()*posts.length)]); }
|
3
|
+
data += `<script>const posts=${JSON.stringify(posts)};function toRandomPost(){ pjax.loadUrl('/'+posts[Math.floor(Math.random()*posts.length)]); }</script>`;
|
4
4
|
return data;
|
5
5
|
});
|
package/scripts/helper/stylus.js
CHANGED
@@ -7,14 +7,7 @@ hexo.extend.filter.register('stylus:renderer', function (style) {
|
|
7
7
|
style.define('highlightTags', array);
|
8
8
|
}
|
9
9
|
|
10
|
-
const aside = [
|
11
|
-
theme.config.aside.home.noSticky,
|
12
|
-
theme.config.aside.home.Sticky,
|
13
|
-
theme.config.aside.post.noSticky,
|
14
|
-
theme.config.aside.post.Sticky,
|
15
|
-
theme.config.aside.page.Sticky,
|
16
|
-
theme.config.aside.page.noSticky
|
17
|
-
].join(',').split(',');
|
10
|
+
const aside = [theme.config.aside.home.noSticky, theme.config.aside.home.Sticky, theme.config.aside.post.noSticky, theme.config.aside.post.Sticky, theme.config.aside.page.Sticky, theme.config.aside.page.noSticky].join(',').split(',');
|
18
11
|
const uniqueArr = [...new Set(aside)];
|
19
12
|
if (uniqueArr.length > 0) {
|
20
13
|
style.define('aside', uniqueArr);
|
@@ -22,12 +15,12 @@ hexo.extend.filter.register('stylus:renderer', function (style) {
|
|
22
15
|
|
23
16
|
style.define('about', data && data.about ? Object.keys(data.about) : []);
|
24
17
|
|
25
|
-
initGroupColor(theme.config.hometop.group,style);
|
18
|
+
initGroupColor(theme.config.hometop.group, style);
|
26
19
|
|
27
|
-
//
|
28
|
-
const {
|
29
|
-
let {
|
30
|
-
let {
|
20
|
+
// highlight
|
21
|
+
const {syntax_highlighter: syntaxHighlighter, highlight, prismjs} = hexo.config
|
22
|
+
let {enable: highlightEnable, line_number: highlightLineNumber} = highlight
|
23
|
+
let {enable: prismjsEnable, line_number: prismjsLineNumber} = prismjs
|
31
24
|
|
32
25
|
// for hexo > 7.0
|
33
26
|
if (syntaxHighlighter) {
|
@@ -41,8 +34,8 @@ hexo.extend.filter.register('stylus:renderer', function (style) {
|
|
41
34
|
style.define('$prismjs_line_number', prismjsLineNumber)
|
42
35
|
});
|
43
36
|
|
44
|
-
function initGroupColor(gg,style) {
|
45
|
-
if(gg === null || gg === undefined) {
|
37
|
+
function initGroupColor(gg, style) {
|
38
|
+
if (gg === null || gg === undefined) {
|
46
39
|
style.define('banner_group', [])
|
47
40
|
return;
|
48
41
|
}
|
@@ -63,5 +56,6 @@ function initGroupColor(gg,style) {
|
|
63
56
|
});
|
64
57
|
return color;
|
65
58
|
}
|
59
|
+
|
66
60
|
style.define('getGroupColor', getGroupColor);
|
67
61
|
}
|