Candinya / Kratos-Rebirth

一个可爱而现代的 Hexo 主题
GNU General Public License v3.0
630 stars 80 forks source link

跑hexo g 报错 #124

Closed rocky08808 closed 2 years ago

rocky08808 commented 2 years ago
  1. 对Bug的描述:

    跑hexo g 报错

    
    Error: /Users/macbookpro/Desktop/tt/blog/themes/kratos-rebirth/layout/post.ejs:100
    98|     <% } %>
    99|     <% if (commentProvider && page.comments) { %>
    >> 100|         <%- partial('_comments/' + commentProvider) %>
    101|     <% } %>
    102| </article>

Partial _comments/[object Object] does not exist. (in post.ejs) at Object.partial (/Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/hexo@6.1.0/node_modules/hexo/lib/plugins/helper/partial.js:16:11) at eval (eval at compile (/Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/ejs@3.1.7/node_modules/ejs/lib/ejs.js:673:12), :201:17) at post (/Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/ejs@3.1.7/node_modules/ejs/lib/ejs.js:703:17) at _View._compiled (/Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/hexo@6.1.0/node_modules/hexo/lib/theme/view.js:136:50) at _View.render (/Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/hexo@6.1.0/node_modules/hexo/lib/theme/view.js:39:17) at /Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/hexo@6.1.0/node_modules/hexo/lib/hexo/index.js:64:21 at tryCatcher (/Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/util.js:16:23) at /Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/bluebird@3.7.2/node_modules/bluebird/js/release/method.js:15:34 at RouteStream._read (/Users/macbookpro/Desktop/tt/blog/node_modules/.pnpm/hexo@6.1.0/nodemodules/hexo/lib/hexo/router.js:47:5) at RouteStream.Readable.read (internal/streams/readable.js:465:10) at resume (internal/streams/readable.js:963:12) at processTicksAndRejections (internal/process/task_queues.js:82:21) { path: '/Users/macbookpro/Desktop/tt/blog/themes/kratos-rebirth/layout/post.ejs' }


2. **复现Bug的方法:**
运行hexo g 即可复现 

3. **期望的行为:**
<!-- 消除Bug后应有的正确表现。 -->

4. **相关的截图:**
<!-- 如果有必要的话,您可以使用截图来方便表达Bug的现象。 -->

5. **运行环境(如果该Bug的产生和环境有关,例如浏览器不兼容导致):**

6. **您的配置文件:**
<!-- 
 - 此处可以附上您的主题配置文件,
 - 或是您觉得可能有关联的配置部分。
 - 请记得隐去隐私内容(例如密码,授权密钥等)
-->

7. **补充内容:**
<!-- 如果有什么需要补充的内容,可以一并附在这里。 -->
ArcticLampyrid commented 2 years ago

配置文件?

rocky08808 commented 2 years ago

根据readme的安装使用配置完之后,运行hexo g, kratos-rebirth/layout/post.ejs,报出的错

Candinya commented 2 years ago

是默认配置模板没有配置站点评论,导致无法获得 posts.comments.provider 因而回落到了 posts.comments 向下兼容的模式,但变成了 Object ,这是一个 bug ,马上会进行修复

Candinya commented 2 years ago

模板已更新,但您可能需要手动调整一下您的主题配置,例如如果您不希望使用评论系统,那么需要麻烦您设置一个空字符串作为评论系统 (参见 5fda64 ) 实在不好意思 🙏

rocky08808 commented 2 years ago

好的,挺喜欢这个项目,给你点个星星,希望能持续维护更新,哈