X-Git-Url: https://git.danieliu.xyz/?p=pinopress.git;a=blobdiff_plain;f=modules%2Freadingtime;fp=modules%2Freadingtime;h=b3ef98fcc58b75a3dc84222e840c69adc417ae31;hp=79833145d950ac83394656523efcb1a6254a479c;hb=6ec6ed4c15ad3c37fbe1076aa33d26e9c21050a9;hpb=1f9da3846f8e78cac52ea5a4c3840dfc391dca53 diff --git a/modules/readingtime b/modules/readingtime index 7983314..b3ef98f 100755 --- a/modules/readingtime +++ b/modules/readingtime @@ -7,8 +7,8 @@ ## READING_TIME in minutes ## config vars -wordsPerMinute=250 +wordsPerMinute=200 # first clean special symbols and lines with whitespace wordcount=`sed -e 's/[^A-Za-z0-9 ]//g' -e '/^\s*$/d' "$1" | wc -w` -export READING_TIME=$(expr $(expr $wordcount + $wordsPerMinute) / $wordsPerMinute) +export READING_TIME=$(expr $(expr $wordcount / $wordsPerMinute) + 1)