Merge pull request #494 from glahajeekn/dev

为 Butterfly 主题新增 HexoPlusPlus_Talk
pull/495/head
Jerry Wong 4 years ago committed by GitHub
commit 3958b486cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -795,6 +795,15 @@ artitalk:
appKey:
option:
# HexoPlusPlus Talk
# see https://hexoplusplus.js.org
hexoplusplus:
domain:
talk:
limit: 10
start: 0
option:
# Pjax [Beta]
# It may contain bugs and unstable, give feedback when you find the bugs.
# https://github.com/MoOx/pjax
@ -952,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

@ -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)
}
})()

@ -11,6 +11,8 @@ block content
include includes/page/categories.pug
when 'artitalk'
include includes/page/artitalk.pug
when 'hpptalk'
include includes/page/hpptalk.pug
default
include includes/page/default-page.pug

Loading…
Cancel
Save