update
This commit is contained in:
Jerry
2021-02-11 01:19:07 +08:00
Unverified
parent 092e6c5e25
commit b063554dd2
3 changed files with 21 additions and 13 deletions

View File

@@ -49,9 +49,6 @@ if (theme.pwa && theme.pwa.enable)
link(rel='stylesheet', href=url_for(theme.CDN.main_css))
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome) media="print" onload="this.media='all'")
if theme.hexoplusplus.enable
link(rel='stylesheet', href=url_for(theme.hexoplusplus.talk.hpptalk_css))
if (theme.snackbar && theme.snackbar.enable)
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css) media="print" onload="this.media='all'")

View File

@@ -1,3 +1,5 @@
- let hpptalkOption = theme.hexoplusplus.talk.option ? JSON.stringify(theme.hexoplusplus.talk.option) : false
if top_img === false
h1.page-title= page.title
@@ -9,16 +11,28 @@ script.
domain: '!{theme.hexoplusplus.domain}',
limit: !{theme.hexoplusplus.talk.limit},
start: !{theme.hexoplusplus.talk.start},
themecss: '!{theme.hexoplusplus.talk.themecss}',
}
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 {
getScript('!{theme.hexoplusplus.talk.hpptalk}').then(init)
addCss()
getScript('!{url_for(theme.CDN.hpptalk)}').then(init)
}
})()