Consistent wording for reading time
This commit is contained in:
parent
f1adcf3918
commit
e907040232
|
@ -12,14 +12,10 @@
|
|||
{% assign reading_wpm = 200 %}
|
||||
{% assign word_count = page.content | split: " " | size %}
|
||||
{% assign reading_time = word_count | divided_by: 200 %}
|
||||
{% case reading_time %}
|
||||
{% when 0 %}
|
||||
{% assign phrase = "less than a minute." %}
|
||||
{% when 1 %}
|
||||
{% assign phrase = "about a minute." %}
|
||||
{% else %}
|
||||
{% if reading_time < 1%}
|
||||
{% assign reading_time = 1 %}
|
||||
{% endif %}
|
||||
{% assign phrase = " minute read" | prepend: reading_time %}
|
||||
{% endcase %}
|
||||
|
||||
<div class="metadata">
|
||||
<time pubdate="pubdate">{{ page.published_date | date: "%b %d, %Y" }} · {{ phrase }}</time>
|
||||
|
|
10
index.liquid
10
index.liquid
|
@ -13,14 +13,10 @@ data:
|
|||
{% assign reading_wpm = 200 %}
|
||||
{% assign word_count = post.content | split: " " | size %}
|
||||
{% assign reading_time = word_count | divided_by: 200 %}
|
||||
{% case reading_time %}
|
||||
{% when 0 %}
|
||||
{% assign phrase = "less than a minute." %}
|
||||
{% when 1 %}
|
||||
{% assign phrase = "about a minute." %}
|
||||
{% else %}
|
||||
{% if reading_time < 1%}
|
||||
{% assign reading_time = 1 %}
|
||||
{% endif %}
|
||||
{% assign phrase = " minute read" | prepend: reading_time %}
|
||||
{% endcase %}
|
||||
<time pubdate="pubdate">{{ post.published_date | date: "%b %d, %Y" }} · {{ phrase }}</time>
|
||||
|
||||
{% if post.data and post.data.tags -%}
|
||||
|
|
Loading…
Reference in a new issue