Jekyll : Reading time without plugins

Estimated reading time of a post is a feature that became popular. There are plenty of Jekyll plugins that address this problem. However if you want to deploy at GitHub Pages, you can’t use those plugins into your blog

That said, the solution is quite simple:

I just created in a read_time.html in my _includes folder:

{% assign words = content | number_of_words %}
{% if words < 360 %}
   1 min
{% else %}
   {{ words | divided_by:180 }} mins
{% endif %} read

And then, I just include it in my post layout:

{% include read_time.html %}


Vinayak Patel

Vinayak Patel

I love creating data science solution.

Categories