Displaying post count in Jekyll

Displaying post count in Jekyll can be achieved by using the size command.

Jekyll is a very popular static site generator built in Ruby and can be used for diverse purposes like for blogs, projects and portfolios.

Display the total number of posts in a site

We can display the total number of all posts or in particular with the following code.

{{ site.posts | size }}

Post count in category

To display the number of posts in particular categories in Jekyll site, we can use CAT with size

{{ site.categories.CAT | size }}

About the Author

lakshman basnet portrait photo

Lakshman enjoys living with technology. Digital marketer by profession, he loves writing and sharing his experience about technology, life and travel in this blog.

Leave a comment