mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 19:40:55 +08:00
feat: 增加Twikoo評論 #402
improvement: 滾動到評論按鈕只要用評論的頁面就出現 improvement: aside狀態存localstore fix: 修復disqusjs沒有設置api時,沒有反代的bugs fix: 修復aside在font-matter aside為false時,收縮按鈕依舊出現和點擊按鈕會出現空白的bugs #398
This commit is contained in:
24
layout/includes/third-party/comments/twikoo.pug
vendored
Normal file
24
layout/includes/third-party/comments/twikoo.pug
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
script.
|
||||
function loadTwikoo () {
|
||||
function init () {
|
||||
twikoo.init({
|
||||
envId: '!{theme.twikoo}'
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof twikoo.init === 'function') {
|
||||
init()
|
||||
} else {
|
||||
$.getScript('!{theme.CDN.twikoo}', init)
|
||||
}
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Twikoo' || !!{theme.comments.lazyload}) {
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('twikoo'), loadTwikoo)
|
||||
else loadTwikoo()
|
||||
} else {
|
||||
function loadOtherComment () {
|
||||
loadTwikoo()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user