diff options
author | Valentin Popov <valentin@popov.link> | 2024-02-14 13:19:23 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-02-14 13:19:23 +0300 |
commit | 5de2d4ac123f86547eccbeef1b6acdc1c3655a25 (patch) | |
tree | c258ba3a91b950159c9fdc400b7b72be8ff99b88 /_includes | |
parent | 98c2bf4188269b6a4cc8adbdeaf7f6fe56155f34 (diff) | |
download | popov.link-5de2d4ac123f86547eccbeef1b6acdc1c3655a25.tar.xz popov.link-5de2d4ac123f86547eccbeef1b6acdc1c3655a25.zip |
Correction of the reading time counter
Diffstat (limited to '_includes')
-rw-r--r-- | _includes/reading-time.html | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/_includes/reading-time.html b/_includes/reading-time.html index dd1960e..a867b66 100644 --- a/_includes/reading-time.html +++ b/_includes/reading-time.html @@ -2,6 +2,10 @@ {{- content | number_of_words | minus: 180 -}} {%- endcapture -%} +{%- if words contains '-' -%} +{{- '1 min read' | strip | normalize_whitespace | xml_escape -}} +{%- endif -%} + {%- unless words contains '-' -%} -{{- words | plus: 150 | divided_by: 150 | append: ' min read' | xml_escape -}} +{{- words | plus: 150 | divided_by: 150 | append: ' min read' | strip | normalize_whitespace | xml_escape -}} {%- endunless -%}
\ No newline at end of file |