MOxFIVE / hexo-theme-yelee

简而不减 Hexo 双栏博客主题; Another simple and elegant theme for Hexo.
http://moxfive.xyz/
1.38k stars 328 forks source link

在文章主题旁显示评论数? #118

Closed bytemain closed 8 years ago

bytemain commented 8 years ago

啥都没弄,就是开启了,就这样了

Unhandled rejection TypeError: /home/ubuntu/workspace/hexo/themes/yelee/layout/index.ejs:1
 >> 1| <%- partial('_partial/archive', {pagination: 2, index: true}) %>

/home/ubuntu/workspace/hexo/themes/yelee/layout/_partial/archive.ejs:3
    1| <% if (pagination == 2){ %>
    2|   <% page.posts.each(function(post){ %>
 >> 3|     <%- partial('article', {post: post, index: true}) %>
    4|   <% }) %>
    5|   <% if (page.total > 1){ %>
    6|     <nav id="page-nav">

/home/ubuntu/workspace/hexo/themes/yelee/layout/_partial/article.ejs:4
    2|   <%if(post.noDate != "true"){%>
    3|     <div class="article-meta">
 >> 4|       <%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
    5|     </div>
    6|   <%}%>
    7|   <div class="article-inner">

/home/ubuntu/workspace/hexo/themes/yelee/layout/_partial/post/date.ejs:5
    3| </a>
    4| 
 >> 5| <% if ((is_home() || (is_post() && !theme.preload_comment)) && theme.show_count && (theme.disqus.on || theme.duoshuo.on || config.disqus_shortname)) { %> 
    6|     <a href="<%- url_for(post.path) %>#comments" title="<%= __('tooltip.jump2comments') %>">
    7|         <i class="fa fa-comments-o" aria-hidden="true"></i>
    8|         <span class="count-comment"></span>

Cannot read property 'on' of undefined
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:425)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:1377)
    at null._compiledSync (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:255:15)
    at View.renderSync (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/theme/view.js:50:21)
    at Object.partial (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/plugins/helper/partial.js:42:17)
    at Object.wrapper (/home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/lodash/lodash.js:4436:19)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:352)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:38:454)
    at null._compiledSync (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:255:15)
    at View.renderSync (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/theme/view.js:50:21)
    at Object.partial (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/plugins/helper/partial.js:42:17)
    at Object.wrapper (/home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/lodash/lodash.js:4436:19)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:165)
    at Query.forEach (/home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/warehouse/lib/query.js:42:5)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:103)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:36:112)
    at null._compiledSync (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:255:15)
    at View.renderSync (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/theme/view.js:50:21)
    at Object.partial (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/plugins/helper/partial.js:42:17)
    at Object.wrapper (/home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/lodash/lodash.js:4436:19)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:35)
    at eval (eval at <anonymous> (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:103)
    at null._compiledSync (/home/ubuntu/workspace/hexo/node_modules/hexo-renderer-ejs/node_modules/ejs/lib/ejs.js:255:15)
    at tryCatcher (/home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at null._compiled (/home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/bluebird/js/release/method.js:15:34)
    at View.render (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/theme/view.js:29:15)
    at /home/ubuntu/workspace/hexo/node_modules/hexo/lib/hexo/index.js:387:25
    at tryCatcher (/home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at /home/ubuntu/workspace/hexo/node_modules/hexo/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/home/ubuntu/workspace/hexo/node_modules/hexo/lib/hexo/router.js:134:3)
    at RouteStream.Readable.read (_stream_readable.js:336:10)
    at resume_ (_stream_readable.js:726:12)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)
MOxFIVE commented 8 years ago

不清楚,我本地调试是正常的。 你可以装一个 Yelee 主题的副本看看 theme: test

git clone https://github.com/MOxFIVE/hexo-theme-yelee.git themes/test
bytemain commented 8 years ago

@MOxFIVE
又新建了个测试了一下,还是不行,,,