Skip to content

Instantly share code, notes, and snippets.

@BryanSchuetz
Created March 5, 2016 15:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BryanSchuetz/1e159a5259a39bd31522 to your computer and use it in GitHub Desktop.
Save BryanSchuetz/1e159a5259a39bd31522 to your computer and use it in GitHub Desktop.
A liquid block for generating the reading time of a given post.
{% capture words %}
{{ content | number_of_words | minus: 180 }}
{% endcapture %}
{% unless words contains “-” %}
{{ words | plus: 180 | divided_by: 180 |
append:minutes to read” }}
{% endunless %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment