diff --git a/_includes/post-meta.html b/_includes/post-meta.html new file mode 100644 index 0000000..351811f --- /dev/null +++ b/_includes/post-meta.html @@ -0,0 +1,11 @@ +{% capture read_time %} + {{ post.content | number_of_words | divided_by: 180 }} +{% endcapture %} +

+ • + {% if read_time != '0' %} + {{ read_time }} + {% else %} + 1 + {% endif %} min read +

diff --git a/_layouts/post.html b/_layouts/post.html index 0f2d483..fed93b3 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -4,7 +4,17 @@
- + {% capture read_time %} + {{ page.content | number_of_words | divided_by: 180 }} + {% endcapture %} +

{{ page.title }}

diff --git a/blog/index.html b/blog/index.html index 915fe1d..3ca3404 100644 --- a/blog/index.html +++ b/blog/index.html @@ -8,7 +8,7 @@

Blog

{% for post in site.posts %}
- + {% include post-meta.html %}

{{ post.title }}

diff --git a/index.html b/index.html index b3c7be7..7120e4f 100644 --- a/index.html +++ b/index.html @@ -20,8 +20,8 @@

I make websites.

{% for post in site.posts limit:1 %} - -

{{ post.title }}

+ {% include post-meta.html %} +

{{ post.title }}

{{ post.excerpt }}

read more or visit blog

{% endfor %}