Showing word counts and reading time initially seemed to be a fancy feature. Easy to implement but may cause the title block a little bit too congested. Actually, tonight I also added view count via Google Firebase, which is pretty cool feature! This will be documented tomorrow night…it’s getting really late or you can say early at the moment.
Day 34 with Hexo.
Goal: Add word count & reading time. Please note, the stats displayed by the plugin is only ESTIMATES, not actual data…
Google Review
My current theme nexT
version is v7.2.0 and it supports hexo-symbols-count-time
plugin. Previously, hexo-wordcount
was a very popular plugin for this feature. Since the theme _config.yml and post.swig have embedded hexo-symbols-count-time. This post will describe how to enable this plugin.
Implementation
Step 1: Install plugin
1 | npm install hexo-symbols-count-time --save |
Step 2: check the theme _config.yml
in yourBlog\themes\next\ folder
1 | symbols_count_time: |
Step 3: if you want you can edit the post.swig
in yourBlog\themes\next\layout\ folder. (I changed the labelForWordCountEst & labelForTimeEst)
1 | {% raw %} |
Step 4: Deploy. You will find the word count & time estimate.
Some Nerdy Complaints
According to hexo-symbols-count-time’s document on github (here). The word count is an estimated number.
1 | symbols_count_time: |
where,
awl: Average Word Length (chars count in word). Default: 4
. You can check this here.
- CN ≈
2
- EN ≈
5
- RU ≈
6
wpm: Words Per Minute. Default: 275
. You can check this here.
- Slow ≈
200
- Normal ≈
275
- Fast ≈
350
Note for Chinese users: because in Chinese language average word length about ~1.5
and if you at most cases write posts in Chinese (without mixed English), recommended to set awl
to 2
and wpm
to 300
.
But if you usually mix your posts with English, awl
to 4
and wpm
to 275
will be nice.
Lan: I actually compared its word count with counts from WORD. The estimate on the lower side is much far off (~5 times higher than actual for words under 10). But as the actual number of words increases, the estimation error tends to decrease to an acceptable range. Or maybe my default awl=4 is not a good choice. OK, no rigorous numerical tests on this yet. If I getting too bored, I will do some tests on it. Later in another country and hopefully during the day…For the moment, we just need to know it’s estimated. BTW, why counting word is difficult? I thought it’s an easy task from an NON-EXPERT view. On the other hand, reading time is a tough number to get.
OK, again I ended this post with the celebration of Day 35…I did much more than adding one plugin LAST night. Nerdy posts will be continued…