When converting my blog from Jekyll to Hexo, I ran into a practical issue. I wanted a list of posts on a page for my Work page, but Hexo applies pagination by default. It took me a while to find out to solve this, so hopefully this post will save you some time.

The solution

After playing around with the Hexo API, I found this solution to get all posts from a category, in this case the page category:

<%# template.ejs %>
<% 
    var posts = site.categories.data.find(
        function(category) { return category.name === page.category })
        .posts.sort('date').reverse()
%>

<%# and then somewhere else in the template.. %>
<% posts.forEach(function(post) { %>
    <%# your post here %>
<% }) %>