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

View File

@@ -795,18 +795,13 @@ artitalk:
appKey: appKey:
option: option:
# HexoPlusPlus All home # HexoPlusPlus Talk
# see https://hexoplusplus.js.org # see https://hexoplusplus.js.org
hexoplusplus: hexoplusplus:
enable: false
domain: domain:
talk: talk:
hpptalk: https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus@main/src/talk_user.js # Here should be the limit must be written version number limit: 10
hpptalk_css: https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus@main/src/talk.css # Here should be the limit must be written version number
limit: 0
start: 0 start: 0
themecss: https://cdn.jsdelivr.net/gh/HexoPlusPlus/CDN@master/plugin/theme/hpp_user_talk/Pofato.css # Default config: https://cdn.jsdelivr.net/gh/HexoPlusPlus/CDN@master/theme/hpp_user_talk/Butter_Fly_1.css / https://cdn.jsdelivr.net/gh/HexoPlusPlus/CDN@master/plugin/theme/hpp_user_talk/Pofato.css
# In order to adapt to the night mode of the Butterfly theme, you can select the CSS in the upper comment or write your own
option: option:
# Pjax [Beta] # Pjax [Beta]
@@ -966,3 +961,5 @@ CDN:
prismjs_autoloader: https://cdn.jsdelivr.net/npm/prismjs/plugins/autoloader/prism-autoloader.min.js prismjs_autoloader: https://cdn.jsdelivr.net/npm/prismjs/plugins/autoloader/prism-autoloader.min.js
artitalk: https://cdn.jsdelivr.net/npm/artitalk artitalk: https://cdn.jsdelivr.net/npm/artitalk
hpptalk: https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus/talk_user.js
hpptalk_css: https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus/talk.css

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.main_css))
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome) media="print" onload="this.media='all'") 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) if (theme.snackbar && theme.snackbar.enable)
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css) media="print" onload="this.media='all'") 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 if top_img === false
h1.page-title= page.title h1.page-title= page.title
@@ -9,16 +11,28 @@ script.
domain: '!{theme.hexoplusplus.domain}', domain: '!{theme.hexoplusplus.domain}',
limit: !{theme.hexoplusplus.talk.limit}, limit: !{theme.hexoplusplus.talk.limit},
start: !{theme.hexoplusplus.talk.start}, start: !{theme.hexoplusplus.talk.start},
themecss: '!{theme.hexoplusplus.talk.themecss}', }
if (!{Boolean(hpptalkOption)}) {
const otherSetting = !{hpptalkOption}
setting = Object.assign(setting, otherSetting)
} }
const init = () => { const init = () => {
new hpp_talk(setting) 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') { if (typeof hpp_talk === 'function') {
init() init()
} else { } else {
getScript('!{theme.hexoplusplus.talk.hpptalk}').then(init) addCss()
getScript('!{url_for(theme.CDN.hpptalk)}').then(init)
} }
})() })()