next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.42k stars 428 forks source link

NexT version 8.0.0 侧边栏无法显示 #106

Closed cangyunye closed 3 years ago

cangyunye commented 4 years ago

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

网站有侧边栏overview(网页概览)信息

就比如这种

Actual behavior

左侧白色贴片部分(mist主题)

Steps to reproduce the behavior

$ hexo s
INFO  Validating config
INFO  ==================================
  ███╗   ██╗███████╗██╗  ██╗████████╗
  ████╗  ██║██╔════╝╚██╗██╔╝╚══██╔══╝
  ██╔██╗ ██║█████╗   ╚███╔╝    ██║
  ██║╚██╗██║██╔══╝   ██╔██╗    ██║
  ██║ ╚████║███████╗██╔╝ ██╗   ██║
  ╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝   ╚═╝
========================================
NexT version 8.0.0
Documentation: https://theme-next.js.org
========================================
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
ERROR Template render error: (F:\hexo\yuhui\themes\next\layout\_partials\sidebar\site-overview.njk) [Line 81, Column 55]
  TypeError: Cannot read property 'replace' of undefined
    at Object._prettifyError (F:\hexo\yuhui\node_modules\nunjucks\src\lib.js:36:11)
    at F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:561:19
    at Template.root [as rootRenderFunc] (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:354:3)
    at Template.render (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:550:10)
    at F:\hexo\yuhui\themes\next\scripts\renderer.js:33:33
    at _View._compiledSync (F:\hexo\yuhui\node_modules\hexo\lib\theme\view.js:132:24)
    at _View.renderSync (F:\hexo\yuhui\node_modules\hexo\lib\theme\view.js:59:25)
    at F:\hexo\yuhui\node_modules\hexo\lib\plugins\helper\partial.js:31:52
    at Cache.apply (F:\hexo\yuhui\node_modules\hexo-util\lib\cache.js:27:46)
    at Object.fragmentCache (F:\hexo\yuhui\node_modules\hexo\lib\plugins\helper\fragment_cache.js:11:34)
    at Object.partial (F:\hexo\yuhui\node_modules\hexo\lib\plugins\helper\partial.js:31:17)
    at Object.callWrap (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:273:14)
    at Object.eval (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:67:64)
    at Object.render (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:131:17)
    at Context.<anonymous> (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:259:23)
    at Object.callWrap (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:273:14)
    at b_sidebar (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:137:67)
    at eval (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:67:86)
    at eval (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:61:1)
    at fn (F:\hexo\yuhui\node_modules\a-sync-waterfall\index.js:26:24)
    at F:\hexo\yuhui\node_modules\a-sync-waterfall\index.js:66:22
    at executeSync (F:\hexo\yuhui\node_modules\a-sync-waterfall\index.js:8:15)
ERROR Template render error: (F:\hexo\yuhui\themes\next\layout\_partials\sidebar\site-overview.njk) [Line 81, Column 55]
  TypeError: Cannot read property 'replace' of undefined
    at Object._prettifyError (F:\hexo\yuhui\node_modules\nunjucks\src\lib.js:36:11)
    at F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:561:19
    at Template.root [as rootRenderFunc] (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:354:3)
    at Template.render (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:550:10)
    at F:\hexo\yuhui\themes\next\scripts\renderer.js:33:33
    at _View._compiledSync (F:\hexo\yuhui\node_modules\hexo\lib\theme\view.js:132:24)
    at _View.renderSync (F:\hexo\yuhui\node_modules\hexo\lib\theme\view.js:59:25)
    at F:\hexo\yuhui\node_modules\hexo\lib\plugins\helper\partial.js:31:52
    at Cache.apply (F:\hexo\yuhui\node_modules\hexo-util\lib\cache.js:27:46)
    at Object.fragmentCache (F:\hexo\yuhui\node_modules\hexo\lib\plugins\helper\fragment_cache.js:11:34)
    at Object.partial (F:\hexo\yuhui\node_modules\hexo\lib\plugins\helper\partial.js:31:17)
    at Object.callWrap (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:273:14)
    at Object.eval (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:67:64)
    at Object.render (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:131:17)
    at Context.<anonymous> (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:259:23)
    at Object.callWrap (F:\hexo\yuhui\node_modules\nunjucks\src\runtime.js:273:14)
    at b_sidebar (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:266:67)
    at eval (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:67:86)
    at eval (eval at _compile (F:\hexo\yuhui\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:61:1)
    at fn (F:\hexo\yuhui\node_modules\a-sync-waterfall\index.js:26:24)
    at F:\hexo\yuhui\node_modules\a-sync-waterfall\index.js:66:22
    at executeSync (F:\hexo\yuhui\node_modules\a-sync-waterfall\index.js:8:15)
INFO  Farewell

Environment Information

Node.js and NPM Information

$ node -v && npm -v
v12.18.3
6.14.6

Package dependencies Information

$ npm ls --depth 0
hexo-site@0.0.0 F:\hexo\yuhui
+-- hexo@5.1.1
+-- hexo-deployer-git@2.1.0
+-- hexo-generator-archive@1.0.0
+-- hexo-generator-category@1.0.0
+-- hexo-generator-feed@3.0.0
+-- hexo-generator-index@2.0.0
+-- hexo-generator-search@2.4.0
+-- hexo-generator-searchdb@1.3.2
+-- hexo-generator-sitemap@2.1.0
+-- hexo-generator-tag@1.0.0
+-- hexo-renderer-ejs@1.0.0
+-- hexo-renderer-jade@0.5.0
+-- hexo-renderer-marked@3.1.0
+-- hexo-renderer-stylus@2.0.0
+-- hexo-server@2.0.0
`-- prism-themes@1.4.0

Hexo Configuration

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: yuhui's blog
subtitle: ''
description: ''
keywords:
author: yuhui
language: zh-CN
timezone: ''

# URL
## If your site is put in a subdirectory, set url as 'http://example.com/child' and root as '/child/'
url: https://cangyunye.gitee.io
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
plugins: hexo-generate-feed
## Themes: https://hexo.io/themes/
theme: next
# search engine

search:
  path: search.xml
  field: post
  format: html
  limit: 10000

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: https://gitee.com/cangyunye/cangyunye.git
  branch: master

NexT Configuration

scheme: Mist
menu:
   home: / || fa fa-home
   about: /about/ || fa fa-user
   tags: /tags/ || fa fa-tags
   categories: /categories/ || fa fa-th
   archives: /archives/ || fa fa-archive
avatar:
  # Replace the default image and set the url here.
  url: /images/avatar.png
social:
  Gitee: https://gitee.com/cangyunye
follow_me:
  RSS: /atom.xml || fa fa-rss
codeblock:
  # Code Highlight theme
  # All available themes: https://theme-next.js.org/highlight/
  theme:
    light: atom-one-dark
    dark: atom-one-dark
  prism:
    light: prism-synthwave84
    dark: prism-synthwave84
github_banner:
  enable: false
  permalink: https://gitee.com/cangyunye/
local_search:
  enable: enable

Other Information

welcome[bot] commented 4 years ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label Bug to this issue, with a confidence of 0.57. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

stevenjoezhang commented 4 years ago

看上去你想要使用 local search,但你的网页上加载了 algolia-search.js。请检查 algolia_search 的有关配置是否有误。

cangyunye commented 4 years ago

看上去你想要使用 local search,但你的网页上加载了 algolia-search.js。请检查 algolia_search 的有关配置是否有误。

algolia_search已经禁用了,不过不知道为什么那个搜索引擎在localhost:4000的时候可以打开一个搜索窗口,发布后就打开不了了

algolia_search:
  enable: false
  hits:
    per_page: 10

补充一个奇怪的地方 如图所示的搜索引擎,我改为local了,但是在 Edge 85.0.564.44 版本 打开就是这样,而且文章的标签是黑色,其实我已经改为红色了

  • 搜索引擎 :image
  • 内置代码 :image

Google Chrome 版本 84.0.4147.135 能正常显示

  • 搜索引擎:image
  • 内置代码 :image
stevenjoezhang commented 4 years ago

先检查一下是不是缓存问题,如果不行的话可以部署到服务器上,我用 edge 浏览器访问试试

799953468 commented 4 years ago

QQ截图20200907125210 edge 85.0.564.44

stevenjoezhang commented 4 years ago

search 的问题应该是解决了。从现在的 https://cangyunye.gitee.io/2020/09/05/learning-java-day4/ 页面来看,问题是站点概览栏目下的 HTML 内容丢失。

stevenjoezhang commented 3 years ago

你的配置文件存在问题:

social:
  Gitee: https://gitee.com/cangyunye

缺少 Font Awesome 图标。请按照默认选项进行更改。

另见 https://github.com/next-theme/hexo-theme-next/commit/d51ca0e2e8c3c19a4cd0f06bfd24e86e66425a8b

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.