mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
feat: twikoo 增加 option 配置
feat: aside widget 增加排序(只對page頁和sticky內的有效) feat: aside 增加自定義 widget improvement: readmode 優化 improvement: html結構優化
This commit is contained in:
17
layout/includes/third-party/comments/twikoo.pug
vendored
17
layout/includes/third-party/comments/twikoo.pug
vendored
@@ -1,16 +1,25 @@
|
||||
- let option = theme.twikoo.option ? JSON.stringify(theme.twikoo.option) : false
|
||||
|
||||
script.
|
||||
(()=>{
|
||||
const $countDom = document.getElementById('twikoo-count')
|
||||
const init = () => {
|
||||
twikoo.init({
|
||||
envId: '!{theme.twikoo}',
|
||||
let initData = {
|
||||
envId: '!{theme.twikoo.envId}',
|
||||
el: '#twikoo-wrap'
|
||||
})
|
||||
}
|
||||
|
||||
if (!{Boolean(option)}) {
|
||||
const otherData = !{option}
|
||||
initData = Object.assign(initData, otherData)
|
||||
}
|
||||
|
||||
twikoo.init(initData)
|
||||
}
|
||||
|
||||
const getCount = () => {
|
||||
twikoo.getCommentsCount({
|
||||
envId: '!{theme.twikoo}',
|
||||
envId: '!{theme.twikoo.envId}',
|
||||
urls: [window.location.pathname],
|
||||
includeReply: false
|
||||
}).then(function (res) {
|
||||
|
||||
Reference in New Issue
Block a user