diff --git a/layout/includes/third-party/abcjs/abcjs.pug b/layout/includes/third-party/abcjs/abcjs.pug index 5778310..d1a32bf 100644 --- a/layout/includes/third-party/abcjs/abcjs.pug +++ b/layout/includes/third-party/abcjs/abcjs.pug @@ -1,5 +1,5 @@ script. - (() = { + (() => { const abcjsInit = () => { const abcjsFn = () => { setTimeout(() => { diff --git a/layout/includes/third-party/card-post-count/twikoo.pug b/layout/includes/third-party/card-post-count/twikoo.pug index e104fa9..21a0004 100644 --- a/layout/includes/third-party/card-post-count/twikoo.pug +++ b/layout/includes/third-party/card-post-count/twikoo.pug @@ -1,5 +1,5 @@ script. - (() => { + (() => { const getCommentUrl = () => { const eleGroup = document.querySelectorAll('#recent-posts .article-title') let urlArray = [] @@ -18,7 +18,9 @@ script. includeReply: false }).then(function (res) { document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => { - item.textContent = res[index].count + if (res[index]) { + item.textContent = res[index].count + } }) }).catch(function (err) { console.log(err) diff --git a/layout/includes/third-party/comments/index.pug b/layout/includes/third-party/comments/index.pug index 001f0bf..eeaf339 100644 --- a/layout/includes/third-party/comments/index.pug +++ b/layout/includes/third-party/comments/index.pug @@ -5,7 +5,7 @@ hr.custom-hr .comment-headline i.fas.fa-comments.fa-fw span= ' ' + _p('comment') - + if theme.comments.use.length > 1 .comment-switch span.first-comment=defaultComment diff --git a/layout/includes/third-party/comments/livere.pug b/layout/includes/third-party/comments/livere.pug index b1fe23d..dbdfb81 100644 --- a/layout/includes/third-party/comments/livere.pug +++ b/layout/includes/third-party/comments/livere.pug @@ -37,7 +37,7 @@ script. : window.loadOtherComment = loadLivere return } - + if ('!{use[0]}' === 'Livere' || !!{lazyload}) { if (!{lazyload}) btf.loadComment(document.getElementById('lv-container'), loadLivere) else loadLivere() diff --git a/layout/includes/third-party/comments/remark42.pug b/layout/includes/third-party/comments/remark42.pug index 2ef7188..895897a 100644 --- a/layout/includes/third-party/comments/remark42.pug +++ b/layout/includes/third-party/comments/remark42.pug @@ -3,7 +3,7 @@ script. (() => { const isShuoshuo = GLOBAL_CONFIG_SITE.pageType === 'shuoshuo' - const option = !{JSON.stringify(option)} + const options = !{JSON.stringify(option)} const loadScript = src => { const script = document.createElement('script') @@ -42,8 +42,8 @@ script. host: '!{host}', site_id: '!{siteId}', theme: document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light', - ...option, - url: isShuoshuo ? window.location.origin + path : (option && option.url) || window.location.origin + window.location.pathname + ...options, + url: isShuoshuo ? window.location.origin + path : (options && options.url) || window.location.origin + window.location.pathname } if (window.REMARK42) { @@ -68,7 +68,7 @@ script. : window.loadOtherComment = loadRemark42 return } - + if ('!{theme.comments.use[0]}' === 'Remark42' || !!{theme.comments.lazyload}) { if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('remark42'), loadRemark42) else loadRemark42() diff --git a/package.json b/package.json index 6eca4a7..8787d82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "5.4.1", + "version": "5.4.2", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": {