hexo-theme-shokax 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- package/_config.yml +26 -5
- package/package.json +8 -7
- package/scripts/filters/locals.js +6 -0
- package/scripts/filters/post.js +2 -0
- package/scripts/generaters/archive.js +13 -1
- package/scripts/generaters/config.js +4 -1
- package/scripts/generaters/images.js +2 -0
- package/scripts/generaters/index.js +2 -0
- package/scripts/generaters/pages.js +0 -2
- package/scripts/generaters/script.js +34 -9
- package/scripts/helpers/asset.js +16 -7
- package/scripts/helpers/engine.js +24 -1
- package/scripts/helpers/list_categories.js +4 -0
- package/scripts/helpers/summary_ai.js +4 -0
- package/scripts/helpers/symbols_count_time.js +14 -8
- package/scripts/plugin/check.js +5 -3
- package/scripts/plugin/index.js +36 -9
- package/scripts/plugin/lib/injects.js +15 -0
- package/scripts/tags/media.js +1 -0
- package/source/js/_app/components/sidebar.js +54 -56
- package/source/js/_app/fireworks.js +6 -137
- package/source/js/_app/globals/globalVars.js +80 -96
- package/source/js/_app/globals/handles.js +81 -60
- package/source/js/_app/globals/themeColor.js +30 -26
- package/source/js/_app/globals/thirdparty.js +25 -24
- package/source/js/_app/globals/tools.js +36 -30
- package/source/js/_app/library/anime.js +30 -15
- package/source/js/_app/library/dom.js +12 -5
- package/source/js/_app/library/loadFile.js +7 -9
- package/source/js/_app/library/proto.js +59 -7
- package/source/js/_app/library/scriptPjax.js +14 -9
- package/source/js/_app/library/storage.js +2 -4
- package/source/js/_app/library/vue.js +16 -19
- package/source/js/_app/page/comment.js +10 -11
- package/source/js/_app/page/common.js +8 -12
- package/source/js/_app/page/fancybox.js +13 -14
- package/source/js/_app/page/post.js +43 -45
- package/source/js/_app/page/search.js +20 -20
- package/source/js/_app/page/tab.js +7 -10
- package/source/js/_app/pjax/domInit.js +29 -29
- package/source/js/_app/pjax/refresh.js +45 -50
- package/source/js/_app/pjax/siteInit.js +27 -31
- package/source/js/_app/player.js +44 -27
- package/test/dom.test.js +0 -86
@@ -1,96 +1,80 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
function setHeaderHightInner(value) {
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
function
|
46
|
-
|
47
|
-
}
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
function
|
58
|
-
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
function
|
70
|
-
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
function setGoToComment(value) {
|
82
|
-
exports.goToComment = value;
|
83
|
-
}
|
84
|
-
exports.setGoToComment = setGoToComment;
|
85
|
-
function setShowContents(value) {
|
86
|
-
exports.showContents = value;
|
87
|
-
}
|
88
|
-
exports.setShowContents = setShowContents;
|
89
|
-
function setToolBtn(value) {
|
90
|
-
exports.toolBtn = value;
|
91
|
-
}
|
92
|
-
exports.setToolBtn = setToolBtn;
|
93
|
-
function setSiteSearch(value) {
|
94
|
-
exports.siteSearch = value;
|
95
|
-
}
|
96
|
-
exports.setSiteSearch = setSiteSearch;
|
1
|
+
import { $dom } from '../library/dom';
|
2
|
+
import initProto from '../library/proto';
|
3
|
+
initProto();
|
4
|
+
export const statics = CONFIG.statics.indexOf('//') > 0 ? CONFIG.statics : CONFIG.root;
|
5
|
+
export const scrollAction = { x: 0, y: 0 };
|
6
|
+
export let diffY = 0;
|
7
|
+
export let originTitle, titleTime;
|
8
|
+
export const BODY = document.getElementsByTagName('body')[0];
|
9
|
+
export const HTML = document.documentElement;
|
10
|
+
export const Container = $dom('#container');
|
11
|
+
export const loadCat = $dom('#loading');
|
12
|
+
export const siteNav = $dom('#nav');
|
13
|
+
export const siteHeader = $dom('#header');
|
14
|
+
export const menuToggle = siteNav.child('.toggle');
|
15
|
+
export const quickBtn = $dom('#quick');
|
16
|
+
export const sideBar = $dom('#sidebar');
|
17
|
+
export const siteBrand = $dom('#brand');
|
18
|
+
export let toolBtn = $dom('#tool');
|
19
|
+
export let toolPlayer;
|
20
|
+
export let backToTop;
|
21
|
+
export let goToComment;
|
22
|
+
export let showContents;
|
23
|
+
export let siteSearch = $dom('#search');
|
24
|
+
export let siteNavHeight, headerHightInner, headerHight;
|
25
|
+
export let oWinHeight = window.innerHeight;
|
26
|
+
export let oWinWidth = window.innerWidth;
|
27
|
+
export let LOCAL_HASH = 0;
|
28
|
+
export let LOCAL_URL = window.location.href;
|
29
|
+
export let pjax;
|
30
|
+
export function setSiteNavHeight(value) {
|
31
|
+
siteNavHeight = value;
|
32
|
+
}
|
33
|
+
export function setHeaderHightInner(value) {
|
34
|
+
headerHightInner = value;
|
35
|
+
}
|
36
|
+
export function setHeaderHight(value) {
|
37
|
+
headerHight = value;
|
38
|
+
}
|
39
|
+
export function setOWinHeight(value) {
|
40
|
+
oWinHeight = value;
|
41
|
+
}
|
42
|
+
export function setOWinWidth(value) {
|
43
|
+
oWinWidth = value;
|
44
|
+
}
|
45
|
+
export function setDiffY(value) {
|
46
|
+
diffY = value;
|
47
|
+
}
|
48
|
+
export function setTitleTime(value) {
|
49
|
+
titleTime = value;
|
50
|
+
}
|
51
|
+
export function setLocalHash(value) {
|
52
|
+
LOCAL_HASH = value;
|
53
|
+
}
|
54
|
+
export function setLocalUrl(value) {
|
55
|
+
LOCAL_URL = value;
|
56
|
+
}
|
57
|
+
export function setPjax(value) {
|
58
|
+
pjax = value;
|
59
|
+
}
|
60
|
+
export function setOriginTitle(value) {
|
61
|
+
originTitle = value;
|
62
|
+
}
|
63
|
+
export function setToolPlayer(value) {
|
64
|
+
toolPlayer = value;
|
65
|
+
}
|
66
|
+
export function setBackToTop(value) {
|
67
|
+
backToTop = value;
|
68
|
+
}
|
69
|
+
export function setGoToComment(value) {
|
70
|
+
goToComment = value;
|
71
|
+
}
|
72
|
+
export function setShowContents(value) {
|
73
|
+
showContents = value;
|
74
|
+
}
|
75
|
+
export function setToolBtn(value) {
|
76
|
+
toolBtn = value;
|
77
|
+
}
|
78
|
+
export function setSiteSearch(value) {
|
79
|
+
siteSearch = value;
|
80
|
+
}
|
@@ -1,80 +1,102 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
const
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
import { sideBarToggleHandle } from '../components/sidebar';
|
2
|
+
import { $dom, getDocHeight } from '../library/dom';
|
3
|
+
import { backToTop, diffY, headerHight, headerHightInner, oWinWidth, originTitle, scrollAction, sideBar, siteBrand, siteHeader, siteNav, statics, titleTime, toolBtn, setSiteNavHeight, setHeaderHightInner, setHeaderHight, setOWinHeight, setOWinWidth, setDiffY, setTitleTime } from './globalVars';
|
4
|
+
import { changeMetaTheme } from './themeColor';
|
5
|
+
import { Loader } from './thirdparty';
|
6
|
+
export const resizeHandle = () => {
|
7
|
+
// 获取 siteNav 的高度
|
8
|
+
setSiteNavHeight(siteNav.changeOrGetHeight());
|
9
|
+
// 获取 siteHeader 的高度
|
10
|
+
setHeaderHightInner(siteHeader.changeOrGetHeight());
|
11
|
+
// 获取 #waves 的高度
|
12
|
+
setHeaderHight(headerHightInner + $dom('#waves').changeOrGetHeight());
|
13
|
+
// 判断窗口宽度是否改变
|
14
|
+
if (oWinWidth !== window.innerWidth) {
|
15
|
+
sideBarToggleHandle(null, 1);
|
15
16
|
}
|
16
|
-
|
17
|
-
(
|
17
|
+
// 记录窗口高度和宽度
|
18
|
+
setOWinHeight(window.innerHeight);
|
19
|
+
setOWinWidth(window.innerWidth);
|
18
20
|
};
|
19
|
-
|
20
|
-
|
21
|
+
export const scrollHandle = () => {
|
22
|
+
// 获取窗口高度
|
21
23
|
const winHeight = window.innerHeight;
|
22
|
-
|
24
|
+
// 获取文档高度
|
25
|
+
const docHeight = getDocHeight();
|
26
|
+
// 计算可见内容高度
|
23
27
|
const contentVisibilityHeight = docHeight > winHeight ? docHeight - winHeight : document.body.scrollHeight - winHeight;
|
24
|
-
|
28
|
+
// 判断页面是否滚动超过 headerHightInner
|
29
|
+
const SHOW = window.scrollY > headerHightInner;
|
30
|
+
// 判断页面是否开始滚动
|
25
31
|
const startScroll = window.scrollY > 0;
|
32
|
+
// 根据条件修改 meta theme
|
26
33
|
if (SHOW) {
|
27
|
-
|
34
|
+
changeMetaTheme('#FFF');
|
28
35
|
}
|
29
36
|
else {
|
30
|
-
|
37
|
+
changeMetaTheme('#222');
|
31
38
|
}
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
// 控制导航栏的显示隐藏
|
40
|
+
siteNav.toggleClass('show', SHOW);
|
41
|
+
// 控制网站 logo 的显示隐藏
|
42
|
+
toolBtn.toggleClass('affix', startScroll);
|
43
|
+
// 控制侧边栏的显示隐藏,当滚动高度大于 headerHight 且窗口宽度大于 991px 时显示
|
44
|
+
siteBrand.toggleClass('affix', startScroll);
|
45
|
+
sideBar.toggleClass('affix', window.scrollY > headerHight && document.body.offsetWidth > 991);
|
46
|
+
// 初始化滚动时导航栏的显示方向
|
47
|
+
if (typeof scrollAction.y === 'undefined') {
|
48
|
+
scrollAction.y = window.scrollY;
|
38
49
|
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
50
|
+
setDiffY(scrollAction.y - window.scrollY);
|
51
|
+
// 控制滑动时导航栏显示
|
52
|
+
if (diffY < 0) {
|
53
|
+
siteNav.removeClass('up');
|
54
|
+
siteNav.toggleClass('down', SHOW);
|
43
55
|
}
|
44
|
-
else if (
|
45
|
-
|
46
|
-
|
56
|
+
else if (diffY > 0) {
|
57
|
+
siteNav.removeClass('down');
|
58
|
+
siteNav.toggleClass('up', SHOW);
|
47
59
|
}
|
48
|
-
else { }
|
49
|
-
|
60
|
+
else { /* empty */ }
|
61
|
+
scrollAction.y = window.scrollY;
|
62
|
+
// 计算滚动百分比
|
50
63
|
const scrollPercent = Math.round(Math.min(100 * window.scrollY / contentVisibilityHeight, 100)) + '%';
|
51
|
-
|
52
|
-
|
64
|
+
// 更新回到顶部按钮的文字
|
65
|
+
if (backToTop.child('span').innerText !== scrollPercent) {
|
66
|
+
backToTop.child('span').innerText = scrollPercent;
|
53
67
|
}
|
54
|
-
|
55
|
-
|
68
|
+
// 更新百分比进度条的宽度
|
69
|
+
if ($dom('#sidebar').hasClass('affix') || $dom('#sidebar').hasClass('on')) {
|
70
|
+
$dom('.percent').changeOrGetWidth(scrollPercent);
|
56
71
|
}
|
57
72
|
};
|
58
|
-
|
59
|
-
|
60
|
-
|
73
|
+
/**
|
74
|
+
* 此函数用于修改右键点击显示菜单 <br/>
|
75
|
+
* 需要在document下存在如下元素:
|
76
|
+
* - id为clickMenu的容器(右键菜单容器)
|
77
|
+
* - class为clickSubmenu的容器(可以有0到无限个)(子菜单容器)
|
78
|
+
* CSS应有如下class:
|
79
|
+
* - clickMenu的active类(控制显示)
|
80
|
+
*/
|
81
|
+
export const clickMenu = () => {
|
82
|
+
const menuElement = $dom('#clickMenu');
|
61
83
|
window.oncontextmenu = function (event) {
|
62
|
-
if (event.ctrlKey) {
|
84
|
+
if (event.ctrlKey) { // 当按下ctrl键时不触发自定义菜单
|
63
85
|
return;
|
64
86
|
}
|
65
87
|
event.preventDefault();
|
66
|
-
let x = event.offsetX;
|
88
|
+
let x = event.offsetX; // 触发点到页面窗口左边的距离
|
67
89
|
let y = event.offsetY;
|
68
|
-
const winWidth = window.innerWidth;
|
90
|
+
const winWidth = window.innerWidth; // 窗口的内部宽度(包括滚动条)
|
69
91
|
const winHeight = window.innerHeight;
|
70
|
-
const menuWidth = menuElement.offsetWidth;
|
92
|
+
const menuWidth = menuElement.offsetWidth; // 菜单宽度
|
71
93
|
const menuHeight = menuElement.offsetHeight;
|
72
94
|
x = winWidth - menuWidth >= x ? x : winWidth - menuWidth;
|
73
95
|
y = winHeight - menuHeight >= y ? y : winHeight - menuHeight;
|
74
96
|
menuElement.style.top = y + 'px';
|
75
97
|
menuElement.style.left = x + 'px';
|
76
98
|
menuElement.classList.add('active');
|
77
|
-
|
99
|
+
$dom.each('.clickSubmenu', (submenu) => {
|
78
100
|
if (x > (winWidth - menuWidth - submenu.offsetWidth)) {
|
79
101
|
submenu.style.left = '-200px';
|
80
102
|
}
|
@@ -88,30 +110,29 @@ const clickMenu = () => {
|
|
88
110
|
menuElement.classList.remove('active');
|
89
111
|
});
|
90
112
|
};
|
91
|
-
|
92
|
-
const visibilityListener = () => {
|
93
|
-
const iconNode =
|
113
|
+
// 可见度监听(离开页面和返回时更改document的title)
|
114
|
+
export const visibilityListener = () => {
|
115
|
+
const iconNode = $dom('[rel="icon"]');
|
94
116
|
document.addEventListener('visibilitychange', () => {
|
95
117
|
switch (document.visibilityState) {
|
96
118
|
case 'hidden':
|
97
|
-
iconNode.attr('href',
|
119
|
+
iconNode.attr('href', statics + CONFIG.favicon.hidden);
|
98
120
|
document.title = LOCAL.favicon.hide;
|
99
121
|
if (CONFIG.loader.switch) {
|
100
|
-
|
122
|
+
Loader.show();
|
101
123
|
}
|
102
|
-
clearTimeout(
|
124
|
+
clearTimeout(titleTime);
|
103
125
|
break;
|
104
126
|
case 'visible':
|
105
|
-
iconNode.attr('href',
|
127
|
+
iconNode.attr('href', statics + CONFIG.favicon.normal);
|
106
128
|
document.title = LOCAL.favicon.show;
|
107
129
|
if (CONFIG.loader.switch) {
|
108
|
-
|
130
|
+
Loader.hide(1000);
|
109
131
|
}
|
110
|
-
|
111
|
-
document.title =
|
132
|
+
setTitleTime(setTimeout(() => {
|
133
|
+
document.title = originTitle;
|
112
134
|
}, 2000));
|
113
135
|
break;
|
114
136
|
}
|
115
137
|
});
|
116
138
|
};
|
117
|
-
exports.visibilityListener = visibilityListener;
|
@@ -1,58 +1,62 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
const changeTheme = (type) => {
|
8
|
-
const btn =
|
1
|
+
import { $storage } from '../library/storage';
|
2
|
+
import { $dom } from '../library/dom';
|
3
|
+
import { HTML } from './globalVars';
|
4
|
+
/**
|
5
|
+
* 更改日夜模式
|
6
|
+
*/
|
7
|
+
export const changeTheme = (type) => {
|
8
|
+
const btn = $dom('.theme .ic');
|
9
9
|
if (type === 'dark') {
|
10
|
-
|
10
|
+
HTML.attr('data-theme', type);
|
11
11
|
btn.removeClass('i-sun');
|
12
12
|
btn.addClass('i-moon');
|
13
13
|
}
|
14
14
|
else {
|
15
|
-
|
15
|
+
HTML.attr('data-theme', null);
|
16
16
|
btn.removeClass('i-moon');
|
17
17
|
btn.addClass('i-sun');
|
18
18
|
}
|
19
19
|
};
|
20
|
-
|
21
|
-
|
20
|
+
/**
|
21
|
+
* 自动调整黑夜白天
|
22
|
+
* 优先级: 手动选择>时间>跟随系统
|
23
|
+
*/
|
24
|
+
export const autoDarkmode = () => {
|
22
25
|
if (CONFIG.auto_dark.enable) {
|
23
26
|
if (new Date().getHours() >= CONFIG.auto_dark.start || new Date().getHours() <= CONFIG.auto_dark.end) {
|
24
|
-
|
27
|
+
changeTheme('dark');
|
25
28
|
}
|
26
29
|
else {
|
27
|
-
|
30
|
+
changeTheme();
|
28
31
|
}
|
29
32
|
}
|
30
33
|
};
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
+
/**
|
35
|
+
* 更改主题的meta
|
36
|
+
*/
|
37
|
+
export const changeMetaTheme = (color) => {
|
38
|
+
if (HTML.attr('data-theme') === 'dark') {
|
34
39
|
color = '#222';
|
35
40
|
}
|
36
|
-
|
41
|
+
$dom('meta[name="theme-color"]').attr('content', color);
|
37
42
|
};
|
38
|
-
|
39
|
-
const themeColorListener = () => {
|
43
|
+
// 记忆日夜模式切换和系统亮暗模式监听
|
44
|
+
export const themeColorListener = () => {
|
40
45
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (mediaQueryList) => {
|
41
46
|
if (mediaQueryList.matches) {
|
42
|
-
|
47
|
+
changeTheme('dark');
|
43
48
|
}
|
44
49
|
else {
|
45
|
-
|
50
|
+
changeTheme();
|
46
51
|
}
|
47
52
|
});
|
48
|
-
const t =
|
53
|
+
const t = $storage.get('theme');
|
49
54
|
if (t) {
|
50
|
-
|
55
|
+
changeTheme(t);
|
51
56
|
}
|
52
57
|
else {
|
53
58
|
if (CONFIG.darkmode) {
|
54
|
-
|
59
|
+
changeTheme('dark');
|
55
60
|
}
|
56
61
|
}
|
57
62
|
};
|
58
|
-
exports.themeColorListener = themeColorListener;
|
@@ -1,25 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
};
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
const
|
9
|
-
const anime_1 = require("../library/anime");
|
10
|
-
exports.lazyload = (0, lozad_1.default)('img, [data-background-image]', {
|
1
|
+
// 与第三方js的交互或第三方嵌入js
|
2
|
+
import lozad from 'lozad';
|
3
|
+
import { loadCat } from './globalVars';
|
4
|
+
import { transition } from '../library/anime';
|
5
|
+
/**
|
6
|
+
* 懒加载图片
|
7
|
+
*/
|
8
|
+
export const lazyload = lozad('img, [data-background-image]', {
|
11
9
|
loaded(el) {
|
12
10
|
el.addClass('lozaded');
|
13
11
|
}
|
14
12
|
});
|
15
|
-
|
13
|
+
// 加载动画
|
14
|
+
export const Loader = {
|
16
15
|
timer: undefined,
|
17
16
|
lock: false,
|
18
17
|
show() {
|
19
18
|
clearTimeout(this.timer);
|
20
19
|
document.body.removeClass('loaded');
|
21
|
-
|
22
|
-
|
20
|
+
loadCat.attr('style', 'display:block');
|
21
|
+
Loader.lock = false;
|
23
22
|
},
|
24
23
|
hide(sec) {
|
25
24
|
if (!CONFIG.loader.start) {
|
@@ -28,17 +27,17 @@ exports.Loader = {
|
|
28
27
|
this.timer = setTimeout(this.vanish, sec || 3000);
|
29
28
|
},
|
30
29
|
vanish() {
|
31
|
-
if (
|
30
|
+
if (Loader.lock) {
|
32
31
|
return;
|
33
32
|
}
|
34
33
|
if (CONFIG.loader.start) {
|
35
|
-
|
34
|
+
transition(loadCat, 0);
|
36
35
|
}
|
37
36
|
document.body.addClass('loaded');
|
38
|
-
|
37
|
+
Loader.lock = true;
|
39
38
|
}
|
40
39
|
};
|
41
|
-
const isOutime = () => {
|
40
|
+
export const isOutime = () => {
|
42
41
|
let updateTime;
|
43
42
|
if (CONFIG.outime.enable && LOCAL.outime) {
|
44
43
|
const times = document.getElementsByTagName('time');
|
@@ -49,17 +48,20 @@ const isOutime = () => {
|
|
49
48
|
if (posts.length === 0) {
|
50
49
|
return;
|
51
50
|
}
|
52
|
-
const now = Date.now();
|
53
|
-
const pubTime = new Date(times[0].dateTime);
|
51
|
+
const now = Date.now(); // 当前时间戳
|
52
|
+
const pubTime = new Date(times[0].dateTime); // 文章发布时间戳
|
54
53
|
if (times.length === 1) {
|
55
|
-
updateTime = pubTime;
|
54
|
+
updateTime = pubTime; // 文章发布时间亦是最后更新时间
|
56
55
|
}
|
57
56
|
else {
|
58
|
-
updateTime = new Date(times[1].dateTime);
|
57
|
+
updateTime = new Date(times[1].dateTime); // 文章最后更新时间戳
|
59
58
|
}
|
60
|
-
|
61
|
-
const
|
59
|
+
// @ts-ignore
|
60
|
+
const interval = parseInt(String(now - updateTime)); // 时间差
|
61
|
+
const days = parseInt(String(CONFIG.outime.days)) || 30; // 设置时效,默认硬编码 30 天
|
62
|
+
// 最后一次更新时间超过 days 天(毫秒)
|
62
63
|
if (interval > (days * 86400000)) {
|
64
|
+
// @ts-ignore
|
63
65
|
const publish = parseInt(String((now - pubTime) / 86400000));
|
64
66
|
const updated = parseInt(String(interval / 86400000));
|
65
67
|
const template = LOCAL.template.replace('{{publish}}', String(publish)).replace('{{updated}}', String(updated));
|
@@ -67,4 +69,3 @@ const isOutime = () => {
|
|
67
69
|
}
|
68
70
|
}
|
69
71
|
};
|
70
|
-
exports.isOutime = isOutime;
|