Skip to content

Commit

Permalink
Allow per-page override of words_per_minute (mmistakes#2250)
Browse files Browse the repository at this point in the history
Different languages usually have different read speeds.
This change is useful for sites with multi-lingual content
  • Loading branch information
iBug authored and mmistakes committed Oct 4, 2019
1 parent ae7d913 commit 5220ee7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _includes/read-time.html
Original file line number Diff line number Diff line change
@@ -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 %}
Expand All @@ -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 %}
{% endif %}

0 comments on commit 5220ee7

Please sign in to comment.