From 18ba086f05e7f4352c5a49b1863827d07fdfe259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?iBug=20=E2=99=A6?= Date: Fri, 4 Oct 2019 22:50:05 +0800 Subject: [PATCH] Allow per-page override of words_per_minute (#2250) Different languages usually have different read speeds. This change is useful for sites with multi-lingual content --- _includes/read-time.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/read-time.html b/_includes/read-time.html index df88d52926a3..588574433c50 100644 --- a/_includes/read-time.html +++ b/_includes/read-time.html @@ -1,4 +1,4 @@ -{% assign words_per_minute = site.words_per_minute | default: 200 %} +{% assign words_per_minute = page.words_per_minute | default: site.words_per_minute | default: 200 %} {% if post.read_time %} {% assign words = post.content | strip_html | number_of_words %} @@ -12,4 +12,4 @@ 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} {% else %} {{ words | divided_by:words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} -{% endif %} \ No newline at end of file +{% endif %}