marcospinello
10/21/2015 - 5:18 PM

Reading time in Jekyll using Liquid templating

Reading time in Jekyll using Liquid templating

{% comment %}
source: https://sojourner.co/blog/code/time-to-read-post-jekyll.html
author: https://sojourner.co/
{% endcomment %}

{% capture count_words %} 
 2 	{{ page.content | number_of_words }} 
 3 {% endcapture %}
 4 	
 5 {% capture time_words %} 
 6 	{{count_words | divided_by: 5}} 
 7 {% endcapture %} 
 8 
 9 {{count_words}} Words in Post.
10 Reading Time:  ~ {{time_words | divided_by: 60}} min. or so.