mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
feat: artalk 支持點擊打開大圖
feat: 設置了隨系統而切換淺色和深色模式後,評論和 mermaind 也會跟隨切換顏色 feat: artalk 最新評論,從 artalk 配置讀取頭像 CDN 和默認頭像 fix: 修復代碼塊在未展開時,點擊複製按鈕,無法複製的 bug improvement: 代碼和性能優化 improvement: artalk 獲取評論數,由 LoadCountWidget 改為 loadCountWidget
This commit is contained in:
12
layout/includes/third-party/comments/disqus.pug
vendored
12
layout/includes/third-party/comments/disqus.pug
vendored
@@ -2,19 +2,21 @@
|
||||
|
||||
script.
|
||||
function loadDisqus () {
|
||||
var disqus_config = function () {
|
||||
const disqus_config = function () {
|
||||
this.page.url = '!{ page.permalink }'
|
||||
this.page.identifier = '!{ url_for(page.path) }'
|
||||
this.page.title = '!{ disqusPageTitle }'
|
||||
};
|
||||
}
|
||||
|
||||
window.disqusReset = () => {
|
||||
const disqusReset = () => {
|
||||
DISQUS.reset({
|
||||
reload: true,
|
||||
config: disqus_config
|
||||
})
|
||||
}
|
||||
|
||||
btf.addModeChange('disqus', disqusReset)
|
||||
|
||||
if (window.DISQUS) disqusReset()
|
||||
else {
|
||||
(function() {
|
||||
@@ -24,10 +26,6 @@ script.
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
}
|
||||
|
||||
document.getElementById('darkmode').addEventListener('click', () => {
|
||||
setTimeout(() => window.disqusReset(), 200)
|
||||
})
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Disqus' || !!{theme.comments.lazyload}) {
|
||||
|
||||
Reference in New Issue
Block a user