This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
forked from mmistakes/minimal-mistakes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set default value for
words_per_minute
- Close mmistakes#657
- Loading branch information
1 parent
799fdcb
commit 301e6f0
Showing
2 changed files
with
14 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
{% assign words_per_minute = site.words_per_minute | default: 200 %} | ||
|
||
{% if post.read_time %} | ||
{% assign words = post.content | strip_html | number_of_words %} | ||
{% elsif page.read_time %} | ||
{% assign words = page.content | strip_html | number_of_words %} | ||
{% endif %} | ||
|
||
{% if site.words_per_minute %} | ||
{% if words < 180 %} | ||
{{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% elsif words < 360 %} | ||
1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% else %} | ||
{{ words | divided_by:site.words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% endif %} | ||
{% if words < 180 %} | ||
{{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% elsif words < 360 %} | ||
1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% else %} | ||
{{ site.data.ui-text[site.locale].undefined_wpm | "Undefined parameter words_per_minute at _config.yml" }} | ||
{{ words | divided_by:words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
{% assign words_per_minute = site.words_per_minute | default: 200 %} | ||
|
||
{% if post.read_time %} | ||
{% assign words = post.content | strip_html | number_of_words %} | ||
{% elsif page.read_time %} | ||
{% assign words = page.content | strip_html | number_of_words %} | ||
{% endif %} | ||
|
||
{% if site.words_per_minute %} | ||
{% if words < 180 %} | ||
{{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% elsif words < 360 %} | ||
1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% else %} | ||
{{ words | divided_by:site.words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% endif %} | ||
{% if words < 180 %} | ||
{{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% elsif words < 360 %} | ||
1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% else %} | ||
{{ site.data.ui-text[site.locale].undefined_wpm | "Undefined parameter words_per_minute at _config.yml" }} | ||
{{ words | divided_by:words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }} | ||
{% endif %} |