Skip to content

Instantly share code, notes, and snippets.

@rajibdpi
Forked from Phlow/jeykll-post-counter.liquid
Created November 30, 2017 20:09
Show Gist options
  • Save rajibdpi/3a391b242a939a1c3c22aeff0e20b81d to your computer and use it in GitHub Desktop.
Save rajibdpi/3a391b242a939a1c3c22aeff0e20b81d to your computer and use it in GitHub Desktop.
Counter: This code snippet just counts your jekyll posts and spits out the result
{% comment %}
*
* Counter: This include counts the your jekyll posts
*
{% endcomment %}{% assign counter = 1 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment