From 54c6a509c74d0926663158dfe00d3f7beac28319 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 5 Jun 2021 00:35:23 +0800 Subject: [PATCH] =?UTF-8?q?breaking=20changes:=20=E7=A7=BB=E9=99=A4=20wali?= =?UTF-8?q?ne=20=E7=9A=84=20emojiCDN=20=E5=92=8C=20emojiMaps=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20fix:=20=E4=BF=AE=E5=BE=A9=20=E5=8D=87=E7=B4=9A?= =?UTF-8?q?=E5=88=B0=20waline=201.x=20=E8=80=8C=E5=87=BA=E7=8F=BE=E7=9A=84?= =?UTF-8?q?=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 1 - layout/includes/third-party/card-post-count/waline.pug | 2 +- layout/includes/third-party/comments/waline.pug | 6 ------ layout/includes/third-party/newest-comments/waline.pug | 7 +++---- package.json | 2 +- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/_config.yml b/_config.yml index dbd1363..5df17fa 100644 --- a/_config.yml +++ b/_config.yml @@ -331,7 +331,6 @@ valine: waline: serverURL: # Waline server address url avatar: monsterid # gravatar style https://zh-tw.gravatar.com/site/implement/images/#default-image - emojiCDN: # emoji CDN bg: # waline background visitor: false option: diff --git a/layout/includes/third-party/card-post-count/waline.pug b/layout/includes/third-party/card-post-count/waline.pug index f823c1e..e748d86 100644 --- a/layout/includes/third-party/card-post-count/waline.pug +++ b/layout/includes/third-party/card-post-count/waline.pug @@ -3,7 +3,7 @@ script. function loadWaline () { function initWaline () { let initData = { - el: '#waline-wrap', + el: null, serverURL: '!{theme.waline.serverURL}', } diff --git a/layout/includes/third-party/comments/waline.pug b/layout/includes/third-party/comments/waline.pug index 0804536..275da02 100644 --- a/layout/includes/third-party/comments/waline.pug +++ b/layout/includes/third-party/comments/waline.pug @@ -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)})) diff --git a/layout/includes/third-party/newest-comments/waline.pug b/layout/includes/third-party/newest-comments/waline.pug index 8a09847..580beae 100644 --- a/layout/includes/third-party/newest-comments/waline.pug +++ b/layout/includes/third-party/newest-comments/waline.pug @@ -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) - }) + }) \ No newline at end of file diff --git a/package.json b/package.json index 0bbc312..f4c9c2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "3.7.7", + "version": "3.7.8", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": {