Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在非默認目錄(_posts)的文章設置分類報錯 #29

Closed
ShinoharaYuri opened this issue Jan 23, 2016 · 2 comments
Closed

在非默認目錄(_posts)的文章設置分類報錯 #29

ShinoharaYuri opened this issue Jan 23, 2016 · 2 comments

Comments

@ShinoharaYuri
Copy link

因為我的blog有收集一些新聞給朋友用…
今天試了一下只留了一個主文章在_posts資料夾,
把分開的咨詢放到其他資料夾(這樣測試就不顯示在主頁了)
但是加分類的時候報錯……
標籤沒有報錯但是發現無法在標籤頁顯示

請問這個是?

Unhandled rejection TypeError: /home/pi/blog/themes/yelee/layout/page.ejs:1
 >> 1| <%- partial('_partial/article', {post: page, index: false}) %>

/home/pi/blog/themes/yelee/layout/_partial/article.ejs:17
15|       <% if (!index){ %>
16|       <div class="article-info article-info-post">
 >> 17|         <%- partial('post/category') %>
18|         <%- partial('post/tag') %>
19|         <div class="clearfix"></div>
20|       </div>

/home/pi/blog/themes/yelee/layout/_partial   /post/category.ejs:3
1| <% if (post.categories && post.categories.length){ %>
2|     <div class="article-category tagcloud">
>> 3|     <%- list_categories(post.categories, {
4|       show_count: false,
5|       class: 'article-category',
6|       style: 'none',

#<Object> is not a function
at Array.find (native)
at prepareQuery (/home/pi/blog/node_modules/hexo/lib/plugins/helper/list_categories.js:35:23)
at flatList (/home/pi/blog/node_modules/hexo/lib/plugins/helper/list_categories.js:95:5)
at Object.listCategoriesHelper (/home/pi/blog/node_modules/hexo/lib/plugins/helper/list_categories.js:118:15)
at eval (eval at <anonymous> (/home/pi/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:167)
at eval (eval at <anonymous> (/home/pi/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:35:70)
at /home/pi/blog/node_modules/ejs/lib/ejs.js:255:15
at Object.exports.render (/home/pi/blog/node_modules/ejs/lib/ejs.js:293:13)
at Hexo.ejsRenderer (/home/pi/blog/node_modules/hexo-renderer-ejs/lib/renderer.js:7:14)
at Render.renderSync (/home/pi/blog/node_modules/hexo/lib/hexo/render.js:87:23)
at View.renderSync (/home/pi/blog/node_modules/hexo/lib/theme/view.js:50:29)
at Object.partial (/home/pi/blog/node_modules/hexo/lib/plugins/helper/partial.js:42:19)
at eval (eval at <anonymous> (/home/pi/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:1013)
at eval (eval at <anonymous> (/home/pi/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:38:454)
at /home/pi/blog/node_modules/ejs/lib/ejs.js:255:15
at Object.exports.render (/home/pi/blog/node_modules/ejs/lib/ejs.js:293:13)
at Hexo.ejsRenderer (/home/pi/blog/node_modules/hexo-renderer-ejs/lib/renderer.js:7:14)
at Render.renderSync (/home/pi/blog/node_modules/hexo/lib/hexo/render.js:87:23)
at View.renderSync (/home/pi/blog/node_modules/hexo/lib/theme/view.js:50:29)
at Object.partial (/home/pi/blog/node_modules/hexo/lib/plugins/helper/partial.js:42:19)
at eval (eval at <anonymous> (/home/pi/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:35)
at eval (eval at <anonymous> (/home/pi/blog/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:101)
at /home/pi/blog/node_modules/ejs/lib/ejs.js:255:15
at Object.exports.render (/home/pi/blog/node_modules/ejs/lib/ejs.js:293:13)
at Hexo.ejsRenderer (/home/pi/blog/node_modules/hexo-renderer-ejs/lib/renderer.js:7:14)
at Hexo.tryCatcher (/home/pi/blog/node_modules/bluebird/js/main/util.js:26:23)
at Hexo.<anonymous> (/home/pi/blog/node_modules/bluebird/js/main/method.js:15:34)
at /home/pi/blog/node_modules/hexo/lib/hexo/render.js:51:21
at tryCatcher (/home/pi/blog/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/home/pi/blog/node_modules/bluebird/js/main/promise.js:507:31)
at Promise._settlePromiseAt (/home/pi/blog/node_modules/bluebird/js/main/promise.js:581:18)
at Promise._settlePromiseAtPostResolution (/home/pi/blog/node_modules/bluebird/js/main/promise.js:245:10)
at Async._drainQueue (/home/pi/blog/node_modules/bluebird/js/main/async.js:128:12)
at Async._drainQueues (/home/pi/blog/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/blog/node_modules/bluebird/js/main/async.js:15:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
@MOxFIVE
Copy link
Owner

MOxFIVE commented Jan 23, 2016

文章需要直接放在 _posts 資料夾下。放再其他資料夾的話會被當成 page (頁面) 處理,並且不會在主頁和文章列表中顯示。同時只有 post (文章) 才支援分類和標籤
https://hexo.io/zh-tw/docs/front-matter.html#u5206_u985E_u548C_u6A19_u7C64

@ShinoharaYuri
Copy link
Author

知道了
感謝回答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants