Can I specify limit numbers in liquid tags?

I am not using other pagination plugin which support category pagination manually, the main reason is github does not support it (the official one does not support category pagination), and I really like it when github pages build my site for me.

This is the codes I am using to show specific category posts into any page

{% for post in site.categories.mycategory limit:20  reversed %}
  <li class="post_list">
    <a style="color:#fff;" href="{{ post.url | prepend: site.baseurl }}">{{ post.title}}</a>
  </li>
{% endfor %}

As you can see I have set limit:20, i.e. only 20 latest post will be display, but I want to create pagination my self, so Can I use any limit liquid tag like this limit:20 to 40 or something like that?, which display only 20 to 40 post only in specific page.

The rest of pagination things I can build via frontmatter, but I want to divide same category page into two or more pages without using any plugin. Just frontmatter magic or anything which github pages support it very well.

Check out this thread on ideas on how to limit the items in your for loop.

https://talk.jekyllrb.com/t/how-to-display-24-items-in-a-carousel/
1 Like