mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
feat: 升級facebook comment js 到 v10 fix: 修復當內容過少時, footer 沒有底部靠攏的bug improvement: 404頁面不再顯示 rightside
34 lines
996 B
Plaintext
34 lines
996 B
Plaintext
- let emojiMaps = '""'
|
|
if site.data.waline
|
|
- emojiMaps = JSON.stringify(site.data.waline)
|
|
|
|
script.
|
|
function loadWaline () {
|
|
function initWaline () {
|
|
const waline = new Waline(Object.assign({
|
|
el: '#waline-wrap',
|
|
serverURL: '!{theme.waline.serverURL}',
|
|
avatar: '#{theme.waline.avatar}',
|
|
path: location.pathname,
|
|
emojiCDN: '#{theme.waline.emojiCDN}',
|
|
emojiMaps: !{emojiMaps},
|
|
visitor: #{theme.waline.visitor},
|
|
dark: 'html[data-theme="dark"]'
|
|
}, !{JSON.stringify(theme.waline.option)}))
|
|
}
|
|
|
|
if (typeof Waline === 'function') initWaline()
|
|
else getScript('!{url_for(theme.CDN.waline)}').then(initWaline)
|
|
}
|
|
|
|
if ('!{theme.comments.use[0]}' === 'Waline' || !!{theme.comments.lazyload}) {
|
|
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
|
|
else setTimeout(loadWaline, 0)
|
|
} else {
|
|
function loadOtherComment () {
|
|
loadWaline()
|
|
}
|
|
}
|
|
|
|
|