aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-02-14 13:19:23 +0300
committerValentin Popov <valentin@popov.link>2024-02-14 13:19:23 +0300
commit5de2d4ac123f86547eccbeef1b6acdc1c3655a25 (patch)
treec258ba3a91b950159c9fdc400b7b72be8ff99b88
parent98c2bf4188269b6a4cc8adbdeaf7f6fe56155f34 (diff)
downloadpopov.link-5de2d4ac123f86547eccbeef1b6acdc1c3655a25.tar.xz
popov.link-5de2d4ac123f86547eccbeef1b6acdc1c3655a25.zip
Correction of the reading time counter
-rw-r--r--_includes/reading-time.html6
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