Files
hexo-theme-butterfly/layout/includes/third-party/comments/waline.pug
Jerry ab6672429f breaking changes: cdn 可一鍵設置 本地文件/可單獨配置主題文件,第三方文件的 cdn
breaking changes: 移除 utterances,giscus, addtoany, busuanzi 的 cdn 配置
2022-02-19 00:43:01 +08:00

29 lines
799 B
Plaintext

- const { serverURL, visitor, option } = theme.waline
script.
function loadWaline () {
function initWaline () {
const waline = new Waline(Object.assign({
el: '#waline-wrap',
serverURL: '!{serverURL}',
path: location.pathname,
visitor: !{visitor},
dark: 'html[data-theme="dark"]'
}, !{JSON.stringify(option)}))
}
if (typeof Waline === 'function') initWaline()
else getScript('!{url_for(theme.asset.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()
}
}