I am new to liquid and Jekyll, using the below code to calculate the post read time on the post page. But how should I calculate the reading time on the home page or any other page to display it below a post title?
When I use the same code on the homepage as well, I get different read times on the home page and inside that particular post.
I think I am not able to get the context of that post to count the number of words on some other page. Please suggest.
<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>