fix: 當設置 comments 為 false 時,如果設置了顯示評論提供的閲讀數,閲讀數無法顯示的 bug

fix: findArchivesTitle bug
This commit is contained in:
Jerry 2022-06-27 01:23:35 +08:00
parent fba180afaf
commit dbb31dec99
5 changed files with 6 additions and 8 deletions

View File

@ -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 || ''

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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": {