mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
feat: gitalk 增加 option 配置
improvement: pug代碼優化
This commit is contained in:
13
layout/includes/third-party/comments/twikoo.pug
vendored
13
layout/includes/third-party/comments/twikoo.pug
vendored
@@ -1,21 +1,12 @@
|
||||
- let option = theme.twikoo.option ? JSON.stringify(theme.twikoo.option) : false
|
||||
|
||||
script.
|
||||
(()=>{
|
||||
const $countDom = document.getElementById('twikoo-count')
|
||||
const init = () => {
|
||||
let initData = {
|
||||
twikoo.init(Object.assign({
|
||||
el: '#twikoo-wrap',
|
||||
envId: '!{theme.twikoo.envId}',
|
||||
region: '!{theme.twikoo.region}'
|
||||
}
|
||||
|
||||
if (!{Boolean(option)}) {
|
||||
const otherData = !{option}
|
||||
initData = Object.assign(initData, otherData)
|
||||
}
|
||||
|
||||
twikoo.init(initData)
|
||||
}, !{JSON.stringify(theme.twikoo.option)}))
|
||||
}
|
||||
|
||||
const getCount = () => {
|
||||
|
||||
Reference in New Issue
Block a user