commit
3958b486cc
@ -0,0 +1,38 @@
|
||||
- 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)
|
||||
}
|
||||
})()
|
Loading…
Reference in New Issue