Reading Time (e.g. 3 mins) with _includes/reading_time.html Template

To add the reading time (e.g. 3 mins) to your posts include the reading_time.html template in your post layout. Example:


{% include reading_time.html %}

_includes/reading_time.html:


<span class="reading-time" title="Estimated read time">
  {% assign words = content | number_of_words %}
  {% if words < 360 %}
    1 min
  {% else %}
    {{ words | divided_by:180 }} mins
  {% endif %}
</span>

Note: The template assumes a reading speed of 180 words per minute (WPM).

Sources