为 Butterfly 添加 HexoPlusPlus_Talk

This commit is contained in:
Open-super
2021-02-09 21:20:55 +08:00
Unverified
parent 1683998280
commit 092e6c5e25
3 changed files with 23 additions and 10 deletions

View File

@@ -801,11 +801,12 @@ hexoplusplus:
enable: false enable: false
domain: domain:
talk: talk:
hpptalk: https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus@1.1.0/talk_user.js # Here should be the limit must be written version number hpptalk: https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus@main/src/talk_user.js # Here should be the limit must be written version number
hpptalk_css: https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus@1.1.0/talk.css # Here should be the limit must be written version number 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 limit: 0
start: 0 start: 0
themecss: # Default config: https://cdn.jsdelivr.net/gh/HexoPlusPlus/CDN@master/theme/hpp_user_talk/Butter_Fly_1.css 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]
@@ -964,4 +965,4 @@ CDN:
prismjs_lineNumber_js: https://cdn.jsdelivr.net/npm/prismjs/plugins/line-numbers/prism-line-numbers.min.js prismjs_lineNumber_js: https://cdn.jsdelivr.net/npm/prismjs/plugins/line-numbers/prism-line-numbers.min.js
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

View File

@@ -50,7 +50,6 @@ 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 if theme.hexoplusplus.enable
script(src=url_for(theme.hexoplusplus.talk.hpptalk))
link(rel='stylesheet', href=url_for(theme.hexoplusplus.talk.hpptalk_css)) link(rel='stylesheet', href=url_for(theme.hexoplusplus.talk.hpptalk_css))
if (theme.snackbar && theme.snackbar.enable) if (theme.snackbar && theme.snackbar.enable)

View File

@@ -3,9 +3,22 @@ if top_img === false
#hpp_talk #hpp_talk
script. script.
new hpp_talk({ (()=>{
id:"hpp_talk", let setting = {
domain: "!{theme.hexoplusplus.domain}", id: "hpp_talk",
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}',
}
const init = () => {
new hpp_talk(setting)
}
if (typeof hpp_talk === 'function') {
init()
} else {
getScript('!{theme.hexoplusplus.talk.hpptalk}').then(init)
}
})()