hexo-theme-shokax 0.1.3 → 0.1.5

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 CHANGED
@@ -23,23 +23,26 @@ pwa:
23
23
  experiments:
24
24
  noPlayer: false # 禁用音乐播放器
25
25
  gradient: false # 使用CSS渐变作为文章封面
26
- gradientCover: "" # 当gradient为true时使用的主页面cover(为空则使用bing随机图片)
26
+ fixedCover: "" # 主页面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
- # 建议使用vercel自行部署,请参考: https://github.com/xizeyoupan/Meting-API
33
+ # 使用vercel自行部署,请参考: https://github.com/xizeyoupan/Meting-API
34
+
35
+ disableVL: false # 禁用可见度监听
33
36
 
34
37
  icon:
35
38
  favicon: "/favicon.ico"
36
39
  apple_touch_icon: "/apple-touch-icon.png"
37
40
 
38
41
  seo:
39
- bing: "bing-key"
40
- google: "google-key"
41
- yandex: "yandex-key"
42
- baidu: "baidu-key"
42
+ bing:
43
+ google:
44
+ yandex:
45
+ baidu:
43
46
 
44
47
  visitor:
45
48
  clarity: false
@@ -28,7 +28,6 @@ menu:
28
28
  statistics: 统计
29
29
  admiration: 赞赏博主
30
30
  friends: 友链
31
- howtoask: 提问的智慧
32
31
  privacy: 隐私政策
33
32
 
34
33
  sidebar:
@@ -31,9 +31,9 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
31
31
 
32
32
  != partial('_partials/header.pug', {}, {cache: true})
33
33
  div(id="imgs" class="pjax")
34
- if theme.experiments.gradient
34
+ if theme.experiments.gradient || theme.experiments.fixedCover
35
35
  //- cover不可用时用Bing随机图片代替
36
- - var coverImage = theme?.experiments?.gradientCover || "https://7ed.net/bing/api"
36
+ - var coverImage = theme.experiments.fixedCover || "https://7ed.net/bing/api"
37
37
  img(src=coverImage)
38
38
  else
39
39
  - var covers = _cover(page, 6)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "a hexo theme based on shoka",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/zkz098/hexo-theme-shokaX",
@@ -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
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
  /* global hexo */
3
- /*
3
+ /*!
4
4
  hexo-symbols-count-time by theme-next
5
5
  under GNU Lesser General Public License v3.0
6
6
  https://github.com/theme-next/hexo-symbols-count-time/blob/master/LICENSE
@@ -606,7 +606,9 @@ const siteInit = function () {
606
606
  CONFIG.quicklink.ignores = LOCAL.ignores;
607
607
  quicklink.listen(CONFIG.quicklink);
608
608
  autoDarkmode();
609
- visibilityListener();
609
+ if (!CONFIG.disableVL) {
610
+ visibilityListener();
611
+ }
610
612
  themeColorListener();
611
613
  algoliaSearch(pjax);
612
614
  window.addEventListener('scroll', scrollHandle);