breaking changes: 移除 waline 的 emojiCDN 和 emojiMaps 配置

fix: 修復 升級到 waline 1.x 而出現的 bug
This commit is contained in:
Jerry
2021-06-05 00:35:23 +08:00
Unverified
parent f0eaf2d8b0
commit 54c6a509c7
5 changed files with 5 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ script.
function loadWaline () {
function initWaline () {
let initData = {
el: '#waline-wrap',
el: null,
serverURL: '!{theme.waline.serverURL}',
}

View File

@@ -1,7 +1,3 @@
- let emojiMaps = '""'
if site.data.waline
- emojiMaps = JSON.stringify(site.data.waline)
script.
function loadWaline () {
function initWaline () {
@@ -10,8 +6,6 @@ script.
serverURL: '!{theme.waline.serverURL}',
avatar: '#{theme.waline.avatar}',
path: location.pathname,
emojiCDN: '#{theme.waline.emojiCDN}',
emojiMaps: !{emojiMaps},
visitor: #{theme.waline.visitor},
dark: '[data-theme="dark"]'
}, !{JSON.stringify(theme.waline.option)}))

View File

@@ -53,11 +53,10 @@ script.
const getComment = () => {
const loadWaline = () => {
Waline.Widget.RecentComments({
el: '#card-newest-comments .aside-list',
serverURL: '!{theme.waline.serverURL}',
count: !{theme.newest_comments.limit}
}).then(comments => {
const walineArray = comments.map(function (e) {
}).then(res => {
const walineArray = res.comments.map(e => {
return {
'content': changeContent(e.comment),
'avatar': getIcon(e.QQAvatar,e.mail),
@@ -91,4 +90,4 @@ script.
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})
})