hexo-theme-shokax 0.4.3 → 0.4.4
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/package.json
CHANGED
package/scripts/plugin/index.js
CHANGED
@@ -47,7 +47,9 @@ hexo.on('generateBefore', () => {
|
|
47
47
|
});
|
48
48
|
hexo.on('generateAfter', () => {
|
49
49
|
// 检查版本更新
|
50
|
-
fetch('https://api.shokax.top/version/hexo'
|
50
|
+
fetch('https://api.shokax.top/version/hexo', { headers: {
|
51
|
+
"User-Agent": "Mozilla/5.0 ShokaX Client (hexo-theme-shokax)"
|
52
|
+
} }).then((res) => {
|
51
53
|
res.json().then((resp) => {
|
52
54
|
try {
|
53
55
|
const latest = resp['version'];
|
@@ -76,29 +76,32 @@ export const siteRefresh = (reload) => {
|
|
76
76
|
postBeauty()
|
77
77
|
})
|
78
78
|
|
79
|
-
const
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
79
|
+
const cpel = $dom('#copyright')
|
80
|
+
if (cpel) {
|
81
|
+
const comment = new IntersectionObserver((entries) => {
|
82
|
+
entries.forEach((entry) => {
|
83
|
+
if (entry.isIntersecting) {
|
84
|
+
if (__shokax_waline__) {
|
85
|
+
import('../components/comments').then(({walinePageview, walineComment}) => {
|
86
|
+
walinePageview()
|
87
|
+
walineComment()
|
88
|
+
})
|
89
|
+
}
|
90
|
+
if (__shokax_twikoo__) {
|
91
|
+
import('../components/tcomments').then(({twikooComment}) => {
|
92
|
+
twikooComment()
|
93
|
+
})
|
94
|
+
}
|
95
|
+
comment.disconnect()
|
92
96
|
}
|
93
|
-
|
94
|
-
|
97
|
+
})
|
98
|
+
}, {
|
99
|
+
root: null,
|
100
|
+
threshold: 0.2
|
95
101
|
})
|
96
|
-
}, {
|
97
|
-
root: null,
|
98
|
-
threshold: 0.2
|
99
|
-
})
|
100
102
|
|
101
|
-
|
103
|
+
comment.observe(cpel)
|
104
|
+
}
|
102
105
|
|
103
106
|
lazyLoad()
|
104
107
|
|