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
This commit is contained in:
parent
69edbfba58
commit
a52394c02e
1 changed files with 2 additions and 2 deletions
|
@ -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 %}
|
{% if post.read_time %}
|
||||||
{% assign words = post.content | strip_html | number_of_words %}
|
{% 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" }}
|
1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ words | divided_by:words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
|
{{ words | divided_by:words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue