hexo-theme-shokax 0.0.1-alpha6 → 0.0.2-alpha1
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 +0 -5
- package/layout/_mixin/comment.pug +2 -0
- package/layout/_partials/footer.pug +1 -1
- package/layout/_partials/header.pug +1 -0
- package/layout/_partials/layout.pug +6 -2
- package/layout/_partials/post/footer.pug +1 -0
- package/layout/_partials/post/post.pug +1 -0
- package/layout/_partials/sidebar/overview.pug +2 -0
- package/package.json +2 -2
- package/scripts/helpers/engine.js +6 -0
- package/scripts/plugin/index.js +4 -4
- package/scripts/plugin/lib/injects-point.js +0 -1
- package/source/css/app.styl +11 -0
package/_config.yml
CHANGED
@@ -7,6 +7,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
7
7
|
head
|
8
8
|
!= partial('_partials/head/head.pug', {}, {cache: true})
|
9
9
|
!= partial('_partials/head/head_com.pug')
|
10
|
+
!= shokax_inject('head')
|
10
11
|
title
|
11
12
|
block title
|
12
13
|
!= `${alternate?alternate + " = ":""}${title}${subtitle?" = "+subtitle:""}`
|
@@ -133,10 +134,11 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
133
134
|
!= _vendor_js()
|
134
135
|
!= _js('app.js')
|
135
136
|
!= partial('_partials/third-party/baidu-analytics.pug', {}, {cache: true})
|
136
|
-
|
137
|
+
if theme.qweather.enable
|
138
|
+
!= partial('_partials/third-party/qweather.pug', {}, {cache: true})
|
137
139
|
!= partial('_partials/third-party/clarity.pug', {}, {cache: true})
|
138
140
|
!= _new_comments('twikoo')
|
139
|
-
|
141
|
+
|
140
142
|
|
141
143
|
- var jsInjects = theme?.inject?.body?.js,cssInjects = theme?.inject?.body?.css
|
142
144
|
if cssInjects
|
@@ -145,5 +147,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
145
147
|
if jsInjects
|
146
148
|
!= js(jsInjects)
|
147
149
|
|
150
|
+
!= shokax_inject('bodyEnd')
|
151
|
+
|
148
152
|
|
149
153
|
|
@@ -35,6 +35,8 @@ div(class="social")
|
|
35
35
|
- var sidebarIcon = '<i class="ic i-' + link.split('||')[1].trim() + '"></i>'
|
36
36
|
!= _url(sidebarURL, sidebarIcon, {title: sidebarURL, class: 'item ' + name})
|
37
37
|
|
38
|
+
!= shokax_inject('sidebar')
|
39
|
+
|
38
40
|
div(class="menu")
|
39
41
|
//!= partial('_partials/sidebar/menu.pug', {}, {cache: true})
|
40
42
|
!= partial('_partials/sidebar/menu.pug')
|
package/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.2-alpha1",
|
4
4
|
"description": "a hexo theme based on shoka",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": "https://github.com/zkz098/hexo-theme-shokaX",
|
7
7
|
"author": "Chou kaitaku",
|
8
|
-
"license": "
|
8
|
+
"license": "BSD-3-Clause",
|
9
9
|
"scripts": {
|
10
10
|
"test": "cd ./source/js && tsc"
|
11
11
|
},
|
@@ -182,3 +182,9 @@ hexo.extend.helper.register('random_color', function () {
|
|
182
182
|
b.toString(16).length > 1 ? b.toString(16) : '0' + b.toString(16)
|
183
183
|
}`
|
184
184
|
})
|
185
|
+
|
186
|
+
hexo.extend.helper.register('shokax_inject', function (point) {
|
187
|
+
return hexo.theme.config.injects[point]
|
188
|
+
.map(item => this.partial(item.layout, item.locals, item.options))
|
189
|
+
.join('')
|
190
|
+
})
|
package/scripts/plugin/index.js
CHANGED
package/source/css/app.styl
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
@import "_variables";
|
2
2
|
|
3
|
+
for $inject_variable in hexo-config('injects.variable')
|
4
|
+
@import $inject_variable;
|
5
|
+
|
3
6
|
@import "_mixins";
|
4
7
|
|
8
|
+
for $inject_mixin in hexo-config('injects.mixin')
|
9
|
+
@import $inject_mixin;
|
10
|
+
|
5
11
|
if $colors = hexo-config('style.colors')
|
6
12
|
@import $colors;
|
7
13
|
else
|
@@ -25,3 +31,8 @@ if $custom = hexo-config('style.custom')
|
|
25
31
|
@import $custom;
|
26
32
|
|
27
33
|
@import "plugin.styl"
|
34
|
+
|
35
|
+
for $inject_style in hexo-config('injects.style')
|
36
|
+
@import $inject_style;
|
37
|
+
|
38
|
+
|