diff --git a/_includes/reading-time.html b/_includes/reading-time.html new file mode 100644 index 0000000..3adbe12 --- /dev/null +++ b/_includes/reading-time.html @@ -0,0 +1,8 @@ + +{% assign words = include.content | number_of_words %} +{% if words < 180 %} + less than 1 minute read +{% else %} + {{ words | divided_by:180 }} minute read +{% endif %} + diff --git a/_layouts/categories.html b/_layouts/categories.html index b7dc6f5..8b9ef72 100644 --- a/_layouts/categories.html +++ b/_layouts/categories.html @@ -14,7 +14,14 @@ layout: default {% assign posts = posts | sort: 'date' | reverse %} {% for post in posts %}
  • - {{ post.date | date: "%b %-d, %Y" }} +

    + + + • {% include reading-time.html content=post.content %} +

    +

    {{ post.title }}

    diff --git a/_layouts/category.html b/_layouts/category.html index b2649f9..d72c7fc 100644 --- a/_layouts/category.html +++ b/_layouts/category.html @@ -6,7 +6,13 @@ layout: default