aboutsummaryrefslogtreecommitdiff
path: root/_includes/reading-time.html
blob: a867b6688f680c7e3807f38ad23c1364f3132f82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
{%- capture words -%}
{{- 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' | strip | normalize_whitespace | xml_escape -}}
{%- endunless -%}