hexo-theme-shokax 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
package/_config.yml
CHANGED
@@ -26,11 +26,14 @@ experiments:
|
|
26
26
|
gradientCover: "" # 当gradient为true时使用的主页面cover(为空则使用bing随机图片)
|
27
27
|
debug: false # 使用debug模式启动
|
28
28
|
disableThemeComment: false # 禁用主题评论系统(一般用于关闭评论或让插件接管评论系统)
|
29
|
+
usingRelative: false # _image.yml 使用相对路径
|
29
30
|
|
30
31
|
playerAPI: "https://api.injahow.cn" # 结尾不带/,只填写域名
|
31
32
|
# 如果条件允许,请参考 https://github.com/injahow/meting-api 自建API
|
32
33
|
# 建议使用vercel自行部署,请参考: https://github.com/xizeyoupan/Meting-API
|
33
34
|
|
35
|
+
disableVL: false # 禁用可见度监听
|
36
|
+
|
34
37
|
icon:
|
35
38
|
favicon: "/favicon.ico"
|
36
39
|
apple_touch_icon: "/apple-touch-icon.png"
|
package/package.json
CHANGED
@@ -43,7 +43,8 @@ hexo.extend.generator.register('script', function (locals) {
|
|
43
43
|
timeout: theme.quicklink.timeout,
|
44
44
|
priority: theme.quicklink.priority
|
45
45
|
},
|
46
|
-
playerAPI: theme.playerAPI
|
46
|
+
playerAPI: theme.playerAPI,
|
47
|
+
disableVL: theme.disableVL
|
47
48
|
}
|
48
49
|
|
49
50
|
if (config?.algolia) {
|
@@ -26,6 +26,8 @@ const randomBG = function (count = 1, image_server = null, image_list = []) {
|
|
26
26
|
const parseImage = function (img, size) {
|
27
27
|
if (img.startsWith('//') || img.startsWith('http')) {
|
28
28
|
return img
|
29
|
+
} else if (hexo.theme.config.experiments?.usingRelative) { // support relative url
|
30
|
+
return img
|
29
31
|
} else {
|
30
32
|
console.warn("sinaimg blocked all request from outside website,so don't use this format")
|
31
33
|
return `https://tva${randomServer}.sinaimg.cn/` + size + '/' + img
|
package/source/js/_app/page.js
CHANGED
@@ -606,7 +606,9 @@ const siteInit = function () {
|
|
606
606
|
CONFIG.quicklink.ignores = LOCAL.ignores;
|
607
607
|
quicklink.listen(CONFIG.quicklink);
|
608
608
|
autoDarkmode();
|
609
|
-
|
609
|
+
if (!CONFIG.disableVL) {
|
610
|
+
visibilityListener();
|
611
|
+
}
|
610
612
|
themeColorListener();
|
611
613
|
algoliaSearch(pjax);
|
612
614
|
window.addEventListener('scroll', scrollHandle);
|