mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
feat: 添加artalk評論 closed #933 fix: 修復 開啟 archor 後, facebook評論加載不正確的 bug fix: 修復 facebook 評論數無法加載的 bug
20 lines
489 B
Plaintext
20 lines
489 B
Plaintext
- const { server, site } = theme.artalk
|
|
|
|
script.
|
|
(() => {
|
|
const getArtalkCount = () => {
|
|
const runWidget = () => {
|
|
Artalk.LoadCountWidget({
|
|
server: '!{server}',
|
|
site: '!{site}',
|
|
countEl: '.artalk-count'
|
|
})
|
|
}
|
|
|
|
if (typeof Artalk === 'function') runWidget()
|
|
else getScript('!{theme.asset.artalk_js}').then(runWidget)
|
|
}
|
|
|
|
|
|
window.pjax ? getArtalkCount() : window.addEventListener('load', getArtalkCount)
|
|
})() |