mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
update
update
This commit is contained in:
11
_config.yml
11
_config.yml
@@ -795,18 +795,13 @@ artitalk:
|
||||
appKey:
|
||||
option:
|
||||
|
||||
# HexoPlusPlus All home
|
||||
# HexoPlusPlus Talk
|
||||
# see https://hexoplusplus.js.org
|
||||
hexoplusplus:
|
||||
enable: false
|
||||
domain:
|
||||
talk:
|
||||
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@main/src/talk.css # Here should be the limit must be written version number
|
||||
limit: 0
|
||||
limit: 10
|
||||
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:
|
||||
|
||||
# Pjax [Beta]
|
||||
@@ -966,3 +961,5 @@ CDN:
|
||||
prismjs_autoloader: https://cdn.jsdelivr.net/npm/prismjs/plugins/autoloader/prism-autoloader.min.js
|
||||
|
||||
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
|
||||
|
||||
@@ -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'")
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})()
|
||||
Reference in New Issue
Block a user