Files
hexo-theme-butterfly/layout/includes/page/hpptalk.pug
Jerry b063554dd2 update
update
2021-02-11 01:19:07 +08:00

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)
}
})()