mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 19:20:53 +08:00
38 lines
939 B
Plaintext
38 lines
939 B
Plaintext
- let hpptalkOption = theme.hexoplusplus.talk.option ? JSON.stringify(theme.hexoplusplus.talk.option) : false
|
|
|
|
if top_img === false
|
|
h1.page-title= page.title
|
|
|
|
#hpp_talk
|
|
script.
|
|
(()=>{
|
|
let setting = {
|
|
id: "hpp_talk",
|
|
domain: '!{theme.hexoplusplus.domain}',
|
|
limit: !{theme.hexoplusplus.talk.limit},
|
|
start: !{theme.hexoplusplus.talk.start},
|
|
}
|
|
|
|
if (!{Boolean(hpptalkOption)}) {
|
|
const otherSetting = !{hpptalkOption}
|
|
setting = Object.assign(setting, otherSetting)
|
|
}
|
|
|
|
const init = () => {
|
|
new hpp_talk(setting)
|
|
}
|
|
|
|
const addCss = () => {
|
|
const link = document.createElement('link')
|
|
link.rel = 'stylesheet'
|
|
link.href = '!{url_for(theme.CDN.hpptalk_css)}'
|
|
document.head.appendChild(link)
|
|
}
|
|
|
|
if (typeof hpp_talk === 'function') {
|
|
init()
|
|
} else {
|
|
addCss()
|
|
getScript('!{url_for(theme.CDN.hpptalk)}').then(init)
|
|
}
|
|
})() |