1
0
mirror of https://github.com/meineerde/holgerjust.de.git synced 2026-02-21 11:02:03 +00:00

Add indicator about average length of read (at 200 wpm)

This commit is contained in:
Holger Just 2016-02-23 19:04:34 +01:00
parent 59a612247e
commit 5a633d5e32

View File

@ -17,6 +17,10 @@
= current_article.date.strftime(blog_settings.date_format)
- if tags?
about #{tags}
|
- words = Nokogiri::HTML::DocumentFragment.parse(yield).search('.//text()').map(&:text).join(' ').split.count
= [1, (words / 200.0).round].max # average reading speed as of http://EzineArticles.com/2298503
min read
%section.post-content= yield