hexo-theme-shokax 0.0.1-alpha1 → 0.0.1-alpha3

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX?ref=badge_shield)
3
3
  ![LICENSE]( https://img.shields.io/github/license/zkz098/hexo-theme-shokaX)
4
4
  ![stars](https://img.shields.io/github/stars/zkz098/hexo-theme-shokaX)
5
-
5
+ ![version](https://shields.io/npm/v/hexo-theme-shokax)
6
6
 
7
7
  此项目是shoka的一个魔改版,致力于提高性能和优化魔改体验 \
8
8
  本项目处于高强度开发期,但github仓库版本已基本可用 \s
package/_config.yml CHANGED
@@ -24,12 +24,13 @@ pwa:
24
24
  experiments:
25
25
  noPlayer: false # 禁用音乐播放器
26
26
  gradient: false # 使用CSS渐变作为文章封面
27
+ gradientCover: "" # 当gradient为true时使用的主页面cover(为空则使用bing随机图片)
28
+ debug: false # 使用debug模式启动
27
29
 
28
30
  icon:
29
31
  favicon: "/favicon.ico"
30
32
  apple_touch_icon: "/apple-touch-icon.png"
31
33
 
32
- baidu_analytics: ""
33
34
  seo:
34
35
  bing: "bing-key"
35
36
  google: "google-key"
@@ -38,6 +39,7 @@ seo:
38
39
 
39
40
  visitor:
40
41
  clarity: false
42
+ baiduAnalytics: false
41
43
 
42
44
  darkmode: false
43
45
  auto_dark: # 自动亮/暗模式
package/_images.yml CHANGED
@@ -1,3 +1,4 @@
1
+ # 此images已失效,见https://github.com/zkz098/hexo-theme-shokaX/issues/6
1
2
  - 6833939bly1giciryrr3rj20zk0m8nhk.jpg
2
3
  - 6833939bly1gicis081o9j20zk0m8dmr.jpg
3
4
  - 6833939bly1gicis3attqj20zk0m8k7l.jpg
@@ -33,7 +33,11 @@ link(rel="alternate" type="application/json" title=siteTitle href=feedLink)
33
33
  if theme.custom.enable
34
34
  != _local_fonts()
35
35
  != _css('app.css')
36
- script(src="https://unpkg.com/vue@3/dist/vue.global.js")
36
+ - var debugVue = theme?.experiments?.debug
37
+ if debugVue
38
+ script(src="https://cdn.staticfile.org/vue/3.2.45/vue.global.js")
39
+ else
40
+ script(src="https://cdn.staticfile.org/vue/3.2.45/vue.global.prod.js")
37
41
  include pwa.pug
38
42
  if twikooLink && !wl
39
43
  != _css("twikoo.css")
@@ -1,17 +1,18 @@
1
1
  //- https://blog.cyfan.top/p/c0af86bb.html#%E5%AE%89%E8%A3%85-Install
2
+ - var timeNow = new Date().getTime()
2
3
  if theme.pwa.enable
3
- script(data-pjax async)
4
- | if ('serviceWorker' in navigator) {
5
- != `navigator.serviceWorker.register(\"/${theme.pwa.serviceworker}?time=${new Date().getTime()}\").then(async (reg) => {`
6
- | if (window.localStorage.getItem('install') !== 'true') {
7
- | window.localStorage.setItem('install', 'true');
8
- | setTimeout(() => {
9
- | window.location.reload()
10
- | }, 500)
11
- | }
12
- | }).catch(err => {
13
- | console.log(err)
14
- | })
15
- | ;
16
- |}
4
+ - var sworker = theme.pwa.serviceworker
5
+ script(data-pjax async).
6
+ if ('serviceWorker' in navigator) {
7
+ navigator.serviceWorker.register("/#{sworker}?time=#{timeNow}").then(async (reg) => {
8
+ if (window.localStorage.getItem('install') !== 'true') {
9
+ window.localStorage.setItem('install', 'true');
10
+ setTimeout(() => {
11
+ window.location.reload()
12
+ }, 500)
13
+ }
14
+ }).catch(err => {
15
+ console.log(err)
16
+ });
17
+ }
17
18
  link(rel="manifest" href=`/${theme.pwa.manifest}`)
@@ -30,13 +30,18 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
30
30
 
31
31
  != partial('_partials/header.pug', {}, {cache: true})
32
32
  div(id="imgs" class="pjax")
33
- - var covers = _cover(page, 6)
34
- if covers.length === 6
35
- ul
36
- each image in covers
37
- li(class="item" data-background-image=image)
33
+ if theme.experiments.gradient
34
+ //- cover不可用时用Bing随机图片代替
35
+ - var coverImage = theme?.experiments?.gradientCover || "https://7ed.net/bing/api"
36
+ img(src=coverImage)
38
37
  else
39
- img(src=covers)
38
+ - var covers = _cover(page, 6)
39
+ if covers.length === 6
40
+ ul
41
+ each image in covers
42
+ li(class="item" data-background-image=image)
43
+ else
44
+ img(src=covers)
40
45
  div(id="waves")
41
46
  svg(class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto")
42
47
  defs
@@ -97,7 +102,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
97
102
  if page.outime === false
98
103
  | outime: false,
99
104
  else
100
- | outime: true,template: "#{ __('outime.template') }",
105
+ | outime: true,template: `!{ __('outime.template') }`,
101
106
  if page.quiz
102
107
  | quiz: {
103
108
  != `choice: \'${__('quiz.choice')}\',`
@@ -1,10 +1,10 @@
1
- - var hmSrc = `https://hm.baidu.com/hm.js?${ theme.baidu_analytics }`
2
- if theme.baidu_analytics
1
+ - var hmSrc = `https://hm.baidu.com/hm.js?${ theme.visitor.baiduAnalytics }`
2
+ if theme.visitor.baiduAnalytics
3
3
  script(data-pjax=true).
4
4
  var _hmt = _hmt || [];
5
5
  (function () {
6
6
  const hm = document.createElement("script");
7
- hm.src = #{hmSrc}
7
+ hm.src = "#{hmSrc}"
8
8
  hm.async = true;
9
9
  const s = document.getElementsByTagName("script")[0];
10
10
  s.parentNode.insertBefore(hm, s);
@@ -18,7 +18,7 @@ script.
18
18
  "fixed": "false",
19
19
  "vertical": "top",
20
20
  "horizontal": "left",
21
- "key": #{theme.qweather.key}
21
+ "key": "#{theme.qweather.key}"
22
22
  }
23
23
  }
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.0.1-alpha1",
3
+ "version": "0.0.1-alpha3",
4
4
  "description": "a hexo theme based on shoka",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/zkz098/hexo-theme-shokaX",
@@ -16,10 +16,10 @@
16
16
  "@types/jquery": "^3.5.14",
17
17
  "@types/js-yaml": "^4.0.5",
18
18
  "@types/lozad": "^1.16.1",
19
- "@types/node": "^18.11.17",
19
+ "@types/node": "^18.11.18",
20
20
  "@types/shelljs": "^0.8.11",
21
- "@typescript-eslint/eslint-plugin": "^5.47.0",
22
- "@typescript-eslint/parser": "^5.47.0",
21
+ "@typescript-eslint/eslint-plugin": "^5.47.1",
22
+ "@typescript-eslint/parser": "^5.47.1",
23
23
  "eslint": "^8.30.0",
24
24
  "eslint-config-standard": "^17.0.0",
25
25
  "eslint-plugin-import": "^2.26.0",
@@ -27,6 +27,7 @@ const randomBG = function (count = 1, image_server = null, image_list = []) {
27
27
  if (img.startsWith('//') || img.startsWith('http')) {
28
28
  return img
29
29
  } else {
30
+ console.warn("sinaimg blocked all request from outside website,so don't use this format")
30
31
  return `https://tva${randomServer}.sinaimg.cn/` + size + '/' + img
31
32
  }
32
33
  }