Skip to content

Instantly share code, notes, and snippets.

@bruno78
Created October 10, 2016 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bruno78/37f0e42e64c92d19a7e64f970a6566dc to your computer and use it in GitHub Desktop.
Save bruno78/37f0e42e64c92d19a7e64f970a6566dc to your computer and use it in GitHub Desktop.
READ TIME - counts the words of your post and calculates the reading time. Add this file to your _includes folder on your Jekyll website.
<span class="reading-time" title="Estimated read time">
{% assign words = content | number_of_words %}
{% if words == 180 %}
1 minute read
{% elsif words < 180 %}
less than 1 minute read
{% else %}
{{ words | plus:90 | divided_by:180 }} minutes read
{% endif %}
</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment