mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:30:53 +08:00
🐛 2.修復評論utterances 在display_mode設置為dark時,仍顯示light主題的bug 🐛 3.修復display_mode設置dark沒有效果的bug 🎨 4.評論增加夜間模式、文章頁判斷,減少不必要的js加載
28 lines
802 B
Plaintext
28 lines
802 B
Plaintext
#gitalk-container
|
|
script.
|
|
var gitalk = new Gitalk({
|
|
clientID: '!{theme.gitalk.client_id}',
|
|
clientSecret: '!{theme.gitalk.client_secret}',
|
|
repo: '!{theme.gitalk.repo}',
|
|
owner: '!{theme.gitalk.owner}',
|
|
admin: ['!{theme.gitalk.admin}'],
|
|
id: md5(decodeURI(location.pathname)),
|
|
language: '!{theme.gitalk.language}',
|
|
perPage: !{theme.gitalk.perPage},
|
|
distractionFreeMode: !{theme.gitalk.distractionFreeMode},
|
|
pagerDirection: '!{theme.gitalk.pagerDirection}',
|
|
createIssueManually: !{theme.gitalk.createIssueManually},
|
|
updateCountCallback: commentCount
|
|
})
|
|
gitalk.render('gitalk-container')
|
|
|
|
function commentCount(n){
|
|
try {
|
|
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
|
|
} catch (e) {
|
|
return false
|
|
}
|
|
}
|
|
|
|
|