Skip to content

Instantly share code, notes, and snippets.

@thecliguy
Forked from Phlow/jeykll-post-counter.liquid
Created February 26, 2017 14:12
Show Gist options
  • Save thecliguy/8506c0d1e3307aecb1592ec5ba8156a2 to your computer and use it in GitHub Desktop.
Save thecliguy/8506c0d1e3307aecb1592ec5ba8156a2 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