feat: twikoo 增加 option 配置

feat: aside widget 增加排序(只對page頁和sticky內的有效)
feat: aside 增加自定義 widget
improvement: readmode 優化
improvement: html結構優化
This commit is contained in:
Jerry
2020-12-24 01:29:09 +08:00
parent 25cf081250
commit d5d5681981
25 changed files with 242 additions and 169 deletions

View File

@@ -4,7 +4,7 @@ script.
function loadWaline () {
function initWaline () {
let initData = {
el: '#waline',
el: '#waline-wrap',
serverURL: '!{theme.waline.serverURL}',
avatar: '#{theme.waline.avatar}',
path: location.pathname,
@@ -12,7 +12,7 @@ script.
if (!{Boolean(option)}) {
const otherData = !{option}
initData = Object.assign({}, initData, otherData)
initData = Object.assign(initData, otherData)
}
const waline = new Waline(initData)
@@ -23,7 +23,7 @@ script.
}
if ('!{theme.comments.use[0]}' === 'Waline' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.querySelector('#waline'),loadWaline)
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
else setTimeout(loadWaline, 0)
} else {
function loadOtherComment () {