theme-next / hexo-theme-next

Elegant and powerful theme for Hexo.
https://theme-next.org
Other
8.15k stars 2.05k forks source link

当设置 related_posts: params: isDate: true 后在特定条件下会导致 hexo g 运行失败 #1456

Open st1020 opened 4 years ago

st1020 commented 4 years ago

Issue Checklist


Expected behavior

在主题配置文件中进行以下设置后,能够正常运行 hexo g

related_posts:
  enable: true
  params:
    isDate: true

Actual behavior

进行如上设置,且博客中存在两篇具有相同 tag 的博文时,会导致运行 hexo g 出现 ERROR Cannot read property 'replace' of null错误

Steps to reproduce the behavior

  1. 进行如上设置并安装相关依赖
  2. 添加两篇 tag 相同的博文
  3. 运行 hexo g

Environment Information

Node.js and NPM Information

v13.12.0
6.14.4

Package dependencies Information

├── hexo@4.2.0
├── hexo-generator-archive@1.0.0
├── hexo-generator-category@1.0.0
├── hexo-generator-index@1.0.0
├── hexo-generator-tag@1.0.0
├── hexo-related-popular-posts@4.0.0
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-marked@2.0.0
├── hexo-renderer-stylus@1.1.0
└── hexo-server@1.0.0

Hexo Configuration

全部保持默认即可重现错误

NexT Configuration

related_posts:
  enable: true
  params:
    isDate: true
welcome[bot] commented 4 years ago

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

st1020 commented 4 years ago

没有人知道我为了定位到这个错误用了多长的时间😭😭😭

hui-shao commented 4 years ago

我遇到同样的问题了,只要设置:

related_posts:
  enable: true

就会在生成时报错

1498

wangworld commented 4 years ago

可暂时屏蔽isDate参数

sli1989 commented 4 years ago

can u check this https://github.com/tea3/hexo-related-popular-posts/pull/27 (support hexo 5.0.0)?