hexo-theme-solitude 1.11.2 → 1.12.0
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/CONTRIBUTING.md +1 -1
- package/README.md +5 -3
- package/README_en-US.md +11 -11
- package/README_zh-Hant.md +10 -10
- package/SECURITY.md +1 -1
- package/_config.yml +48 -36
- package/languages/default.yml +3 -1
- package/languages/en.yml +3 -1
- package/languages/zh-CN.yml +2 -0
- package/languages/zh-TW.yml +2 -0
- package/layout/includes/console.pug +4 -3
- package/layout/includes/head/config.pug +1 -0
- package/layout/includes/inject/body.pug +0 -3
- package/layout/includes/inject/head.pug +2 -2
- package/layout/includes/widgets/aside/asideNewstComments.pug +9 -0
- package/layout/includes/widgets/aside/asideSwitch.pug +2 -0
- package/layout/includes/widgets/third-party/comments/artalk.pug +1 -1
- package/layout/includes/widgets/third-party/comments/comment.pug +3 -1
- package/layout/includes/widgets/third-party/comments/giscus.pug +60 -0
- package/layout/includes/widgets/third-party/comments/js.pug +3 -1
- package/layout/includes/widgets/third-party/news-comment/artalk.pug +10 -12
- package/layout/includes/widgets/third-party/news-comment/newest-comment.pug +6 -5
- package/layout/includes/widgets/third-party/news-comment/twikoo.pug +9 -9
- package/layout/includes/widgets/third-party/news-comment/valine.pug +8 -7
- package/layout/includes/widgets/third-party/news-comment/waline.pug +8 -7
- package/package.json +3 -3
- package/scripts/event/merge_config.js +17 -16
- package/scripts/event/welcome.js +1 -1
- package/scripts/filter/default.js +2 -2
- package/source/css/_highlight/index.styl +1 -1
- package/source/css/_layout/aside.styl +53 -6
- package/source/css/_layout/console.styl +3 -79
- package/source/css/_page/message.styl +2 -1
- package/source/css/_post/meta.styl +4 -14
- package/source/css/_post/tools.styl +7 -2
- package/source/css/_search/local-search.styl +4 -0
- package/source/img/404.avif +0 -0
- package/source/img/avatar.avif +0 -0
- package/source/img/default.avif +0 -0
- package/source/img/error_load.avif +0 -0
- package/source/img/happy-sticker.avif +0 -0
- package/source/img/loading.avif +0 -0
- package/source/img/recent_c.avif +0 -0
- package/source/js/main.js +15 -12
- package/source/js/utils.js +8 -0
- package/source/img/404.webp +0 -0
- package/source/img/avatar.png +0 -0
- package/source/img/default.png +0 -0
- package/source/img/error_load.webp +0 -0
- package/source/img/happy-sticker.png +0 -0
- package/source/img/loading.gif +0 -0
package/source/js/main.js
CHANGED
@@ -329,7 +329,7 @@ let sco = {
|
|
329
329
|
*/
|
330
330
|
addRuntime: function () {
|
331
331
|
let el = document.getElementById('runtimeshow')
|
332
|
-
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.
|
332
|
+
el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.day)
|
333
333
|
},
|
334
334
|
/**
|
335
335
|
* toTalk
|
@@ -775,17 +775,20 @@ class tabs {
|
|
775
775
|
}
|
776
776
|
|
777
777
|
static clickFnOfTabs() {
|
778
|
-
document.querySelectorAll('#article-container .tab > button').forEach(item
|
779
|
-
item.addEventListener('click', e
|
780
|
-
const
|
778
|
+
document.querySelectorAll('#article-container .tab > button').forEach(function (item) {
|
779
|
+
item.addEventListener('click', function (e) {
|
780
|
+
const that = this
|
781
|
+
const $tabItem = that.parentNode
|
781
782
|
if (!$tabItem.classList.contains('active')) {
|
782
783
|
const $tabContent = $tabItem.parentNode.nextElementSibling
|
783
|
-
const $siblings = $tabItem
|
784
|
+
const $siblings = utils.siblings($tabItem, '.active')[0]
|
784
785
|
$siblings && $siblings.classList.remove('active')
|
785
786
|
$tabItem.classList.add('active')
|
786
|
-
const tabId =
|
787
|
-
|
788
|
-
|
787
|
+
const tabId = that.getAttribute('data-href').replace('#', '')
|
788
|
+
const childList = [...$tabContent.children]
|
789
|
+
childList.forEach(item => {
|
790
|
+
if (item.id === tabId) item.classList.add('active')
|
791
|
+
else item.classList.remove('active')
|
789
792
|
})
|
790
793
|
}
|
791
794
|
})
|
@@ -793,14 +796,14 @@ class tabs {
|
|
793
796
|
}
|
794
797
|
|
795
798
|
static backToTop() {
|
796
|
-
document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(item
|
797
|
-
item.addEventListener('click', ()
|
798
|
-
utils.scrollToDest(utils.getEleTop(item.
|
799
|
+
document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(function (item) {
|
800
|
+
item.addEventListener('click', function () {
|
801
|
+
utils.scrollToDest(utils.getEleTop(item.parentElement.parentElement.parentNode), 300)
|
802
|
+
|
799
803
|
})
|
800
804
|
})
|
801
805
|
}
|
802
806
|
}
|
803
|
-
|
804
807
|
// 页面刷新
|
805
808
|
window.refreshFn = () => {
|
806
809
|
const {is_home, is_page, page, is_post} = PAGE_CONFIG;
|
package/source/js/utils.js
CHANGED
@@ -59,6 +59,14 @@
|
|
59
59
|
}
|
60
60
|
return actualTop;
|
61
61
|
},
|
62
|
+
siblings: (ele, selector) => {
|
63
|
+
return [...ele.parentNode.children].filter((child) => {
|
64
|
+
if (selector) {
|
65
|
+
return child !== ele && child.matches(selector)
|
66
|
+
}
|
67
|
+
return child !== ele
|
68
|
+
})
|
69
|
+
},
|
62
70
|
randomNum: (length) => {
|
63
71
|
return Math.floor(Math.random() * length)
|
64
72
|
},
|
package/source/img/404.webp
DELETED
Binary file
|
package/source/img/avatar.png
DELETED
Binary file
|
package/source/img/default.png
DELETED
Binary file
|
Binary file
|
Binary file
|
package/source/img/loading.gif
DELETED
Binary file
|