Pelican plugin: word count and reading time statistics

I’ve just released a tiny library for Pelican blog platform called word count. It’s a plugin that extends articles and pages with the basic text statistics: number of words and approximate reading time in minutes. You can use it then in your HTML template. My own theme supports it too.

It turned out that there is another plugin called post_stats. It provides even more extensive stats. But I think it’s an overkill for my purposes: I don’t need text readability features, they won’t work for non-English text, they slow down site generation. I also suspect that post_stats is run against all the contents, including non-text ones, which is also not so good for plugin performance.

My word count plugin explicitly runs against text entities (articles, pages, drafts and translations). It calculates basic statistics I need for my blog. And that’s it.

I prefer to add Pelican plugins as git submodule. It makes it easier to git clone the entire blog with all its themes and plugins on the new machine. It’s also make it easier to version plugins and themes you use. Just check out your submodule to the version needed. Check out my article Pelican blog: up and running for more details.

You can donwload (or better git clone) word_count plugin on the GitHub.