diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3a0628e0..affd53b6 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -37,6 +37,16 @@   {{ end }} {{ end }} + {{ if .Site.Params.enableReadingTime }} + schedule + {{ $readTime := mul (div (countwords .Content) 220.0) 60 }} + + {{ $minutes := math.Floor (div $readTime 60) }} + {{ $seconds := mod $readTime 60 }} + + {{ $minutes }} {{ cond (eq $minutes 1) "minute" "min" }} + {{ $seconds }} {{ cond (eq $seconds 1) "second" "s" }}. + {{ end }}