hexo-theme-shokax 0.0.8 → 0.1.1
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 +3 -0
- package/layout/_alternate/atom.ejs +1 -1
- package/layout/_alternate/json.ejs +1 -1
- package/layout/_alternate/rss.ejs +1 -1
- package/layout/_mixin/comment.pug +12 -5
- package/layout/_partials/post/post.pug +1 -1
- package/layout/_partials/post/reward.pug +1 -1
- package/package.json +1 -1
- package/scripts/generaters/script.js +2 -1
- package/scripts/helpers/asset.js +1 -1
- package/scripts/tags/links.js +1 -1
- package/source/css/_common/components/pages/pages.styl +1 -1
- package/source/css/_common/components/tags/player.styl +2 -2
- package/source/css/_common/components/third-party/search.styl +2 -2
- package/source/js/_app/library.js +2 -2
- package/source/js/_app/page.js +1 -1
- package/source/js/_app/player.js +1 -1
package/_config.yml
CHANGED
@@ -28,6 +28,8 @@ experiments:
|
|
28
28
|
debug: false # 使用debug模式启动
|
29
29
|
disableThemeComment: false # 禁用主题评论系统(一般用于关闭评论或让插件接管评论系统)
|
30
30
|
|
31
|
+
playerAPI: "https://api.injahow.cn" # 结尾不带/,只填写域名
|
32
|
+
|
31
33
|
icon:
|
32
34
|
favicon: "/favicon.ico"
|
33
35
|
apple_touch_icon: "/apple-touch-icon.png"
|
@@ -156,6 +158,7 @@ waline:
|
|
156
158
|
- mail
|
157
159
|
wordLimit: 0 # 字数限制,0为不限制
|
158
160
|
pageSize: 10 # 每页评论条数
|
161
|
+
pageview: true # 是否开启浏览量统计
|
159
162
|
|
160
163
|
# https://github.com/gitalk/gitalk/blob/master/readme-cn.md
|
161
164
|
gitalk:
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<id><%= config.url %></id>
|
4
4
|
<title><%= config.title %></title>
|
5
5
|
<subtitle><%= config.subtitle %></subtitle>
|
6
|
-
<icon><%= full_url_for('/
|
6
|
+
<icon><%= full_url_for('/assets/favicon.ico') %></icon>
|
7
7
|
<link href="<%= config.url %>" />
|
8
8
|
<author>
|
9
9
|
<name><%= config.author %></name>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
version: 'https://jsonfeed.org/version/1',
|
3
3
|
title: config.title,
|
4
4
|
subtitle: config.subtitle,
|
5
|
-
icon: full_url_for('/
|
5
|
+
icon: full_url_for('/assets/favicon.ico'),
|
6
6
|
description: config.description,
|
7
7
|
home_page_url: config.url,
|
8
8
|
items: posts.map(post => ({
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<channel>
|
4
4
|
<title><%= config.title %></title>
|
5
5
|
<subtitle><%= config.subtitle %></subtitle>
|
6
|
-
<icon><%= full_url_for('/
|
6
|
+
<icon><%= full_url_for('/assets/favicon.ico') %></icon>
|
7
7
|
<link><%= config.url %></link>
|
8
8
|
<author>
|
9
9
|
<name><%= config.author %></name>
|
@@ -14,20 +14,27 @@ mixin CommentRender()
|
|
14
14
|
}, 1000)
|
15
15
|
else if wl
|
16
16
|
div(class="warp" id="wcomments")
|
17
|
+
- var locale = JSON.stringify(theme.waline.locale)
|
18
|
+
- var emoji = JSON.stringify(theme.waline.emoji)
|
19
|
+
- var meta = JSON.stringify(theme.waline.meta)
|
20
|
+
- var requiredMeta = JSON.stringify(theme.waline.requiredMeta)
|
17
21
|
script(type="module" data-pjax).
|
18
22
|
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
|
19
23
|
|
24
|
+
var path = document.getElementById("twikoo_visitors").getAttribute("data-path");
|
20
25
|
setTimeout(function () {
|
21
26
|
init({
|
22
27
|
el: '#wcomments',
|
23
28
|
serverURL: '#{hexo.theme.config.waline.serverURL}',
|
24
29
|
lang: '#{hexo.theme.config.waline.lang}',
|
25
|
-
locale:
|
26
|
-
emoji:
|
27
|
-
meta:
|
28
|
-
requiredMeta:
|
30
|
+
locale: !{locale},
|
31
|
+
emoji: !{emoji},
|
32
|
+
meta: !{meta},
|
33
|
+
requiredMeta: !{requiredMeta},
|
29
34
|
wordLimit: #{hexo.theme.config.waline.wordLimit},
|
30
|
-
pageSize: #{hexo.theme.config.waline.pageSize}
|
35
|
+
pageSize: #{hexo.theme.config.waline.pageSize},
|
36
|
+
pageview: #{theme.waline.pageview},
|
37
|
+
path: path
|
31
38
|
});
|
32
39
|
}, 1000)
|
33
40
|
else if gt
|
@@ -2,7 +2,7 @@
|
|
2
2
|
article(itemscope itemtype="http://schema.org/Article" class="post block" lang=temp)
|
3
3
|
link(itemprop="mainEntityOfPage" href!=post.permalink)
|
4
4
|
span(hidden itemprop="author" itemscope itemtype="http://schema.org/Person")
|
5
|
-
meta(itemprop="image" content=url_for(theme.statics + theme.
|
5
|
+
meta(itemprop="image" content=url_for(theme.statics + theme.assets + '/' + theme.sidebar.avatar))
|
6
6
|
meta(itemprop="name" content=author)
|
7
7
|
meta(itemprop="description" content=`${ subtitle }, ${ description }`)
|
8
8
|
span(hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization")
|
@@ -13,6 +13,6 @@ if page.reward !== false
|
|
13
13
|
else
|
14
14
|
- var translation = name
|
15
15
|
div
|
16
|
-
img(data-src=`${url_for(theme.statics + theme.
|
16
|
+
img(data-src=`${url_for(theme.statics + theme.assets + image) }` alt=`${ author } ${ translation }`)
|
17
17
|
p
|
18
18
|
!= translation
|
package/package.json
CHANGED
package/scripts/helpers/asset.js
CHANGED
@@ -38,7 +38,7 @@ hexo.extend.helper.register('_new_comments', function (mode) {
|
|
38
38
|
</script>`
|
39
39
|
} else if (mode === 'waline') {
|
40
40
|
return `
|
41
|
-
<script type="module">
|
41
|
+
<script type="module" data-pjax>
|
42
42
|
import { RecentComments } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs'
|
43
43
|
RecentComments({
|
44
44
|
el: '#new-comment',
|
package/scripts/tags/links.js
CHANGED
@@ -53,7 +53,7 @@ function linkGrid (args, content) {
|
|
53
53
|
urlparam = new URL(item.url)
|
54
54
|
}
|
55
55
|
|
56
|
-
let item_image = item.image || theme.
|
56
|
+
let item_image = item.image || theme.assets + '/404.png'
|
57
57
|
|
58
58
|
if (!item_image.startsWith('//') && !item_image.startsWith('http')) {
|
59
59
|
item_image = theme.statics + item_image
|
@@ -303,7 +303,7 @@
|
|
303
303
|
content: "";
|
304
304
|
position: absolute;
|
305
305
|
z-index: 1;
|
306
|
-
background: url("../
|
306
|
+
background: url("../assets/play_needle.png") no-repeat center/contain;
|
307
307
|
width: 3.4375rem;
|
308
308
|
height: 5.1875rem;
|
309
309
|
top: -1.5625rem;
|
@@ -322,7 +322,7 @@
|
|
322
322
|
&::after {
|
323
323
|
content: "";
|
324
324
|
position: absolute;
|
325
|
-
background: url("../
|
325
|
+
background: url("../assets/play_disc.png") no-repeat center/contain;
|
326
326
|
z-index: 1;
|
327
327
|
width: 100%;
|
328
328
|
height: 100%;
|
@@ -71,7 +71,7 @@
|
|
71
71
|
padding: 1.875rem 1.875rem .3125rem;
|
72
72
|
border-radius: .3125rem;
|
73
73
|
|
74
|
-
background: var(--grey-1-a7) url(../
|
74
|
+
background: var(--grey-1-a7) url(../assets/search.png) no-repeat bottom right;
|
75
75
|
|
76
76
|
color: var(--text-color);
|
77
77
|
|
@@ -91,7 +91,7 @@
|
|
91
91
|
|
92
92
|
.algolia-powered {
|
93
93
|
float: right;
|
94
|
-
background: url('../
|
94
|
+
background: url('../assets/algolia_logo.svg') no-repeat;
|
95
95
|
display: inline-block;
|
96
96
|
height: 1.125rem;
|
97
97
|
width: 4.25rem;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
const getDocHeight = () => $dom('main > .inner').offsetHeight;
|
2
2
|
const $dom = (selector, element = document) => {
|
3
|
-
if (selector
|
4
|
-
return element.getElementById(selector.
|
3
|
+
if (selector[0] === '#') {
|
4
|
+
return element.getElementById(selector.substring(1));
|
5
5
|
}
|
6
6
|
return element.querySelector(selector);
|
7
7
|
};
|
package/source/js/_app/page.js
CHANGED
package/source/js/_app/player.js
CHANGED
@@ -388,7 +388,7 @@ const mediaPlayer = function (t, config) {
|
|
388
388
|
resolve(list);
|
389
389
|
}
|
390
390
|
else {
|
391
|
-
fetch(
|
391
|
+
fetch(`${CONFIG.playerAPI}/meting/api?server=` + meta[0] + '&type=' + meta[1] + '&id=' + meta[2] + '&r=' + Math.random())
|
392
392
|
.then(function (response) {
|
393
393
|
return response.json();
|
394
394
|
}).then(function (json) {
|