From 5de2d4ac123f86547eccbeef1b6acdc1c3655a25 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 14 Feb 2024 14:19:23 +0400 Subject: Correction of the reading time counter --- _includes/reading-time.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '_includes') 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 -- cgit v1.2.3