nielsenramon / chalk

Chalk is a high quality, completely customizable, performant and 100% free Jekyll blog theme.
http://chalk.nielsenramon.com
MIT License
1.23k stars 443 forks source link

Multi-language reading time estimate #196

Open haojian opened 5 years ago

haojian commented 5 years ago

Hi,

The current reading time (e.g., x minutes read) estimate the time by counting only the number of English words. I want to create a pull request to add multi-language support. I located the relevant code is in "index.html".

{{ post.date | date: "%B %-d, %Y" }} - {% capture words %} {{ post.content | number_of_words }} {% endcapture %} {% unless words contains "-" %} {{ words | plus: 250 | divided_by: 250 | append: " minute read" }} {% endunless %} - {% for tag in post.tags %} {{ tag }} {% endfor %}

I am wondering how can I make the changes?
Any help or pointers are appreciated. I have little experience with Ruby.