Skip to content


Subversion checkout URL

You can clone with
Download ZIP


How to select all posts in a certain tag or category and assign it to page.posts of the page I just created? #493

daisygao opened this Issue · 7 comments

3 participants


When I try to create a page "\Projects" to list all my posts with category "Projects" in an Archive-page style, I use the command "hexo n category Projects". However, when rendering the page using category.ejs, page.posts can't be recognized. I wonder if there's a way to let this page object be filled with all posts with category "Projects"?



I tried hexo n page "Projects" and set the category: Projects. The result is the same. page.posts equals null. How could I assign all the posts with category "Projects" to page.posts?


I know url /categories/Projects returns exactly what I want. I truly want to understand how to select all posts in a certain tag or category though. Thanks!


Though I don't understand why you want to do this. You can use

<% site.categories.findOne({name: 'projects'}) %>

in the templates.

@tommy351 tommy351 added the question label

Thanks! I'm not familiar with node.js grammer >3< This is mongoDB usage right?


No, Hexo uses Warehouse, a simple JSON database with MongoDB-like syntax.


Cool. Thanks for explaining^^


if problem solved, please close it, thanks

@tommy351 tommy351 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.