theme-particlex / hexo-theme-particlex

A concise Hexo theme, based on Particle.
MIT License
410 stars 56 forks source link

site.categories.data.forEach is not a function #99

Closed FuseFairy closed 10 months ago

FuseFairy commented 11 months ago

配置标签会出现下错误,已完全按照教学去设置category和tag,但这2个页面依然没法正常显示,谢谢。

ERROR
TypeError: C:\Users\ASUS\github page\FuseFairy.github.io\themes\particlex\layout\categories.ejs:5
    3|     <div class="categories-tags">
    4|         <% let prev; %>
 >> 5|         <% site.categories.data.forEach(category => { %>
    6|         <%
    7|             const colors = is_category(category.name)
    8|                 ? ["linear-gradient(120deg, #9abbf7 0%, #ffbbf4 100%)"]

site.categories.data.forEach is not a function
    at eval (eval at compile (C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\ejs\lib\ejs.js:673:12), <anonymous>:18:29)
    at categories (C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\ejs\lib\ejs.js:703:17)
    at _View._compiled (C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\hexo\dist\theme\view.js:125:67)
    at _View.render (C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\hexo\dist\theme\view.js:50:21)
    at C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\hexo\dist\hexo\index.js:58:29
    at tryCatcher (C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\bluebird\js\release\util.js:16:23)
    at C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\bluebird\js\release\method.js:15:34
    at RouteStream._read (C:\Users\ASUS\github page\FuseFairy.github.io\node_modules\hexo\dist\hexo\router.js:43:9)
    at Readable.read (node:internal/streams/readable:547:12)
    at resume_ (node:internal/streams/readable:1048:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
zkz098 commented 10 months ago

https://github.com/hexojs/hexo/issues/5367 Hexo v7版本已知问题,主题使用了非规范属性导致的,等hexo修复或者换成标准的Query获取 降级到6.3.0也可解决

zkz098 commented 10 months ago

此Issue内解决方法会导致cat.path丢失(即分类无法跳转到对应链接) @argvchs 建议添加对hexo v7的不兼容说明

FuseFairy commented 10 months ago

已解决,谢谢