From dbb31dec99c326b07e8bf004be165e65472562d5 Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 27 Jun 2022 01:23:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=95=B6=E8=A8=AD=E7=BD=AE=20comments?= =?UTF-8?q?=20=E7=82=BA=20false=20=E6=99=82=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E8=A8=AD=E7=BD=AE=E4=BA=86=E9=A1=AF=E7=A4=BA=E8=A9=95=E8=AB=96?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E7=9A=84=E9=96=B2=E8=AE=80=E6=95=B8=EF=BC=8C?= =?UTF-8?q?=E9=96=B2=E8=AE=80=E6=95=B8=E7=84=A1=E6=B3=95=E9=A1=AF=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=20bug=20fix:=20findArchivesTitle=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/head.pug | 6 ++---- layout/includes/header/index.pug | 2 +- layout/includes/header/post-info.pug | 2 +- layout/includes/third-party/newest-comments/remark42.pug | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/layout/includes/head.pug b/layout/includes/head.pug index 3f9e95b..dcf3b74 100644 --- a/layout/includes/head.pug +++ b/layout/includes/head.pug @@ -1,9 +1,7 @@ - var pageTitle -- if (is_archive()) pageTitle = fragment_cache('findArchivesTitle', function(){return findArchivesTitle(theme.menu);}) -- else if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag +- is_archive() ? page.title = findArchivesTitle(page, theme.menu, date) : '' +- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag - else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category -- else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year -- else if (is_year()) pageTitle += ': ' + page.year - else if (is_current('/404.html', [strict])) pageTitle = _p('error404') - else pageTitle = page.title || config.title || '' diff --git a/layout/includes/header/index.pug b/layout/includes/header/index.pug index 18e7dd7..d1aa7c0 100644 --- a/layout/includes/header/index.pug +++ b/layout/includes/header/index.pug @@ -19,7 +19,7 @@ if !theme.disable_top_img && page.top_img !== false if top_img !== false - var imgSource = top_img && top_img.indexOf('/') !== -1 ? `background-image: url('${url_for(top_img)}')` : `background: ${top_img}` - var bg_img = top_img ? imgSource : '' - - var site_title = is_archive() ? findArchivesTitle(page, theme.menu, date) : page.title || page.tag || page.category || config.title + - var site_title = page.title || page.tag || page.category || config.title - var isHomeClass = is_home() ? 'full_page' : 'not-home-page' - is_post() ? isHomeClass = 'post-bg' : isHomeClass else diff --git a/layout/includes/header/post-info.pug b/layout/includes/header/post-info.pug index 6b951c4..40e6b13 100644 --- a/layout/includes/header/post-info.pug +++ b/layout/includes/header/post-info.pug @@ -62,7 +62,7 @@ block - const commentUse = comments.use - if commentUse && !comments.lazyload + if page.comments !== false && commentUse && !comments.lazyload if commentUse[0] === 'Valine' && theme.valine.visitor +pvBlock(url_for(page.path),'leancloud_visitors',page.title) span.leancloud-visitors-count diff --git a/layout/includes/third-party/newest-comments/remark42.pug b/layout/includes/third-party/newest-comments/remark42.pug index d14adb9..8ead708 100644 --- a/layout/includes/third-party/newest-comments/remark42.pug +++ b/layout/includes/third-party/newest-comments/remark42.pug @@ -66,7 +66,7 @@ script. const newestCommentInit = () => { if (document.querySelector('#card-newest-comments .aside-list')) { - const data = saveToLocal.get('valine-newest-comments') + const data = saveToLocal.get('remark42-newest-comments') if (data) { generateHtml(JSON.parse(data)) } else { diff --git a/package.json b/package.json index d2a80b6..d5a1144 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "4.3.0", + "version": "4.3.1", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": {