Skip to content

Instantly share code, notes, and snippets.

@Phlow
Last active November 22, 2019 00:27
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save Phlow/b31f3a8d292aa63081c6 to your computer and use it in GitHub Desktop.
Save Phlow/b31f3a8d292aa63081c6 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 your jekyll posts
*
{% endcomment %}{% assign counter = 0 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}
@Richzendy
Copy link

must be:

{% assign counter = 0 %}

@Phlow
Copy link
Author

Phlow commented Nov 10, 2018

must be:

{% assign counter = 0 %}

You're right :) Thankyou!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment