Skip to content

Instantly share code, notes, and snippets.

@hguochen
Created January 7, 2014 06:36
Show Gist options
  • Select an option

  • Save hguochen/8295469 to your computer and use it in GitHub Desktop.

Select an option

Save hguochen/8295469 to your computer and use it in GitHub Desktop.
Jekyll plugin - word_count minute read
{% capture words %}
{{ post.content | number_of_words | divided_by:180 }}
{% endcapture %}
{% assign word_count = words | times: 1 %}
{% if word_count != 0 %}
<span>{{ word_count }} minute read</span>
{% else %}
<span>less than {{ word_count | plus: 1 }} minute read</span>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment