diff --git a/_config.yml b/_config.yml
index 00d6125..b4f07dc 100644
--- a/_config.yml
+++ b/_config.yml
@@ -200,7 +200,7 @@ language_switcher: false
footer:
# Specify the year when the site was setup. If not defined, current year will be used.
- #since: 2020
+ #since: 2021
# Icon between year and copyright info.
icon:
@@ -387,7 +387,7 @@ back2top:
reading_progress:
enable: false
# Available values: left | right
- startAt: left
+ start_at: left
# Available values: top | bottom
position: top
reversed: false
@@ -560,11 +560,6 @@ quicklink:
# Default (true) will attempt to use the fetch() API if supported (rather than link[rel=prefetch]).
priority: true
- # For more flexibility you can add some patterns (RegExp, Function, or Array) to ignores.
- # See: https://github.com/GoogleChromeLabs/quicklink#custom-ignore-patterns
- # This option is deprecated. Use `CONFIG.quicklink.ignores` in your custom scripts instead.
- ignores:
-
# ---------------------------------------------------------------
# Comments Settings
diff --git a/scripts/events/lib/injects.js b/scripts/events/lib/injects.js
index f3d7977..6a7c323 100644
--- a/scripts/events/lib/injects.js
+++ b/scripts/events/lib/injects.js
@@ -28,7 +28,7 @@ class ViewInject {
if (path.extname(name) === '') {
name += defaultExtname;
}
- this.raws.push({name, raw, args});
+ this.raws.push({ name, raw, args });
}
file(name, file, ...args) {
// Set default extname from file's extname
diff --git a/scripts/filters/comment/changyan.js b/scripts/filters/comment/changyan.js
index a9792a0..4b64d6a 100644
--- a/scripts/filters/comment/changyan.js
+++ b/scripts/filters/comment/changyan.js
@@ -10,7 +10,7 @@ hexo.extend.filter.register('theme_inject', injects => {
const config = hexo.theme.config.changyan;
if (!config.enable || !config.appid || !config.appkey) return;
- injects.comment.raw('changyan', '
', {}, {cache: true});
+ injects.comment.raw('changyan', '', {}, { cache: true });
injects.bodyEnd.file('changyan', path.join(hexo.theme_dir, 'layout/_third-party/comments/changyan.njk'));
diff --git a/scripts/filters/comment/disqus.js b/scripts/filters/comment/disqus.js
index cd01e56..9c2efa0 100644
--- a/scripts/filters/comment/disqus.js
+++ b/scripts/filters/comment/disqus.js
@@ -14,7 +14,7 @@ hexo.extend.filter.register('theme_inject', injects => {
- `, {}, {cache: true});
+ `, {}, { cache: true });
injects.bodyEnd.file('disqus', path.join(hexo.theme_dir, 'layout/_third-party/comments/disqus.njk'));
diff --git a/scripts/filters/comment/disqusjs.js b/scripts/filters/comment/disqusjs.js
index 1fecb6c..a7a44bb 100644
--- a/scripts/filters/comment/disqusjs.js
+++ b/scripts/filters/comment/disqusjs.js
@@ -13,7 +13,7 @@ hexo.extend.filter.register('theme_inject', injects => {
- `, {}, {cache: true});
+ `, {}, { cache: true });
injects.bodyEnd.file('disqusjs', path.join(hexo.theme_dir, 'layout/_third-party/comments/disqusjs.njk'));
diff --git a/scripts/filters/comment/gitalk.js b/scripts/filters/comment/gitalk.js
index a68c078..5acd5d0 100644
--- a/scripts/filters/comment/gitalk.js
+++ b/scripts/filters/comment/gitalk.js
@@ -9,7 +9,7 @@ hexo.extend.filter.register('theme_inject', injects => {
const theme = hexo.theme.config;
if (!theme.gitalk.enable) return;
- injects.comment.raw('gitalk', '', {}, {cache: true});
+ injects.comment.raw('gitalk', '', {}, { cache: true });
injects.bodyEnd.file('gitalk', path.join(hexo.theme_dir, 'layout/_third-party/comments/gitalk.njk'));
diff --git a/scripts/filters/comment/livere.js b/scripts/filters/comment/livere.js
index 9cab5c6..865754f 100644
--- a/scripts/filters/comment/livere.js
+++ b/scripts/filters/comment/livere.js
@@ -9,7 +9,7 @@ hexo.extend.filter.register('theme_inject', injects => {
const theme = hexo.theme.config;
if (!theme.livere_uid) return;
- injects.comment.raw('livere', '', {}, {cache: true});
+ injects.comment.raw('livere', '', {}, { cache: true });
injects.bodyEnd.file('livere', path.join(hexo.theme_dir, 'layout/_third-party/comments/livere.njk'));
diff --git a/source/css/_common/components/reading-progress.styl b/source/css/_common/components/reading-progress.styl
index 11e85e9..f5ca166 100644
--- a/source/css/_common/components/reading-progress.styl
+++ b/source/css/_common/components/reading-progress.styl
@@ -11,7 +11,7 @@
width: var(--progress);
}
- if (hexo-config('reading_progress.startAt') == 'right') {
+ if (hexo-config('reading_progress.start_at') == 'right') {
right: 0;
} else {
left: 0;
diff --git a/source/js/config.js b/source/js/config.js
index 4d6d7ad..12d8f19 100644
--- a/source/js/config.js
+++ b/source/js/config.js
@@ -6,14 +6,14 @@ if (!window.NexT) window.NexT = {};
const staticConfig = {};
let variableConfig = {};
- const parse = (text) => {
+ const parse = text => {
const jsonString = new DOMParser()
.parseFromString(text, 'text/html').documentElement
.textContent;
return JSON.parse(jsonString || '{}');
};
- const update = (name) => {
+ const update = name => {
const targetEle = document.querySelector(`.${className}[data-name="${name}"]`);
if (!targetEle) return;
const parsedConfig = parse(targetEle.text);
@@ -48,7 +48,7 @@ if (!window.NexT) window.NexT = {};
// When mixable
if (typeof override === 'object' && typeof existing === 'object') {
// Mix, proxy changes to the override.
- return new Proxy({...existing, ...override}, {
+ return new Proxy({ ...existing, ...override }, {
set(target, prop, value) {
target[prop] = value;
override[prop] = value;
diff --git a/source/js/third-party/comments/changyan.js b/source/js/third-party/comments/changyan.js
index 475d99d..7d5a859 100644
--- a/source/js/third-party/comments/changyan.js
+++ b/source/js/third-party/comments/changyan.js
@@ -4,7 +4,7 @@ document.addEventListener('page:loaded', () => {
if (CONFIG.page.isHome) {
NexT.utils.getScript(
`https://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=${CONFIG.changyan.appid}`,
- { attributes: {id: 'cy_cmt_num' } }
+ { attributes: { id: 'cy_cmt_num' } }
);
} else if (CONFIG.page.comments) {
NexT.utils.loadComments('#SOHUCS')
diff --git a/source/js/third-party/math/mathjax.js b/source/js/third-party/math/mathjax.js
index fddd173..7c7c487 100644
--- a/source/js/third-party/math/mathjax.js
+++ b/source/js/third-party/math/mathjax.js
@@ -6,7 +6,7 @@ document.addEventListener('page:loaded', () => {
if (typeof MathJax === 'undefined') {
window.MathJax = {
tex: {
- inlineMath: {'[+]': [['$', '$']]},
+ inlineMath: { '[+]': [['$', '$']] },
tags : CONFIG.mathjax.tags
},
options: {
diff --git a/source/js/third-party/rating.js b/source/js/third-party/rating.js
index ca65ec4..fc61a3a 100644
--- a/source/js/third-party/rating.js
+++ b/source/js/third-party/rating.js
@@ -11,7 +11,7 @@
document.addEventListener('page:loaded', () => {
if (!CONFIG.page.isPost) return;
- const newWidgets = widgets.map(widget => ({...widget}));
+ const newWidgets = widgets.map(widget => ({ ...widget }));
if (window.WPac) {
WPac.init(newWidgets);
diff --git a/source/js/third-party/statistics/firestore.js b/source/js/third-party/statistics/firestore.js
index 3d8f657..0cbb60f 100644
--- a/source/js/third-party/statistics/firestore.js
+++ b/source/js/third-party/statistics/firestore.js
@@ -23,7 +23,7 @@ firebase.initializeApp({
});
};
- const appendCountTo = (el) => {
+ const appendCountTo = el => {
return count => {
el.innerText = count;
};
diff --git a/source/js/third-party/statistics/lean-analytics.js b/source/js/third-party/statistics/lean-analytics.js
index baadbc0..b5d4205 100644
--- a/source/js/third-party/statistics/lean-analytics.js
+++ b/source/js/third-party/statistics/lean-analytics.js
@@ -2,19 +2,19 @@
/* eslint-disable no-console */
(function() {
- const leancloudSelector = (url) => {
+ const leancloudSelector = url => {
url = encodeURI(url);
return document.getElementById(url).querySelector('.leancloud-visitors-count');
};
- const addCount = (Counter) => {
+ const addCount = Counter => {
const visitors = document.querySelector('.leancloud_visitors');
const url = decodeURI(visitors.id);
const title = visitors.dataset.flagTitle;
- Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({url}))}`)
+ Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({ url }))}`)
.then(response => response.json())
- .then(({results}) => {
+ .then(({ results }) => {
if (results.length > 0) {
const counter = results[0];
leancloudSelector(url).innerText = counter.time + 1;
@@ -31,7 +31,7 @@
leancloudSelector(url).innerText = 'Counter not initialized! More info at console err msg.';
console.error('ATTENTION! LeanCloud counter has security bug, see how to solve it here: https://github.com/theme-next/hexo-leancloud-counter-security. \n However, you can still use LeanCloud without security, by setting `security` option to `false`.');
} else {
- Counter('post', '/classes/Counter', {title, url, time: 1})
+ Counter('post', '/classes/Counter', { title, url, time: 1 })
.then(response => response.json())
.then(() => {
leancloudSelector(url).innerText = 1;
@@ -46,15 +46,15 @@
});
};
- const showTime = (Counter) => {
+ const showTime = Counter => {
const visitors = document.querySelectorAll('.leancloud_visitors');
const entries = [...visitors].map(element => {
return decodeURI(element.id);
});
- Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({url: {'$in': entries}}))}`)
+ Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({ url: { '$in': entries } }))}`)
.then(response => response.json())
- .then(({results}) => {
+ .then(({ results }) => {
for (const url of entries) {
const target = results.find(item => item.url === url);
leancloudSelector(url).innerText = target ? target.time : 0;
@@ -65,8 +65,8 @@
});
};
- const {app_id, app_key, server_url} = CONFIG.leancloud_visitors;
- const fetchData = (api_server) => {
+ const { app_id, app_key, server_url } = CONFIG.leancloud_visitors;
+ const fetchData = api_server => {
const Counter = (method, url, data) => {
return fetch(`${api_server}/1.1${url}`, {
method,
@@ -94,7 +94,7 @@
} else {
fetch(`https://app-router.leancloud.cn/2/route?appId=${app_id}`)
.then(response => response.json())
- .then(({api_server}) => {
+ .then(({ api_server }) => {
fetchData(`https://${api_server}`);
});
}
diff --git a/source/js/third-party/tags/mermaid.js b/source/js/third-party/tags/mermaid.js
index a345d60..77af6ac 100644
--- a/source/js/third-party/tags/mermaid.js
+++ b/source/js/third-party/tags/mermaid.js
@@ -16,9 +16,9 @@ document.addEventListener('page:loaded', () => {
mermaid.init({
theme : CONFIG.mermaid.theme,
logLevel : 3,
- flowchart: {curve: 'linear'},
- gantt : {axisFormat: '%m/%d/%Y'},
- sequence : {actorMargin: 50}
+ flowchart: { curve: 'linear' },
+ gantt : { axisFormat: '%m/%d/%Y' },
+ sequence : { actorMargin: 50 }
}, '.mermaid');
});
}
diff --git a/source/js/utils.js b/source/js/utils.js
index 7995394..af7e6a2 100644
--- a/source/js/utils.js
+++ b/source/js/utils.js
@@ -22,7 +22,7 @@ if (typeof DOMTokenList.prototype.replace !== 'function') {
);
if (document.readyState === 'loading') {
- document.addEventListener('readystatechange', onPageLoaded, {once: true});
+ document.addEventListener('readystatechange', onPageLoaded, { once: true });
} else {
onPageLoaded();
}
@@ -392,7 +392,7 @@ NexT.utils = {
if (legacyCallback) {
return this.loadComments(selector).then(legacyCallback);
}
- return new Promise((resolve) => {
+ return new Promise(resolve => {
const element = document.querySelector(selector);
if (!CONFIG.comments.lazyload || !element) {
resolve();