duncan­lock­.net

This is a Pelican plugin to calculate various statistics about a post and store them in an article.stats dictionary. You can see this in action in the sidebar on the left of this site.

Nice touch from medium.com - now available in Pelican.

I wanted to implement the nice little “X min read” thing from Medium - and it turned out that it was easy to provide a few other interesting stats at the same time, for people to use in their templates.

The returned article.stats dictionary contains the following:

  • wc: how many words
  • read_mins: how many minutes would it take to read this article, based on 250 wpm
  • word_counts: frequency count of all the words in the article; can be used for tag/word clouds
  • fi: Flesch-kincaid Index/ Reading Ease
  • fk: Flesch-kincaid Grade Level

For example:

{
    'wc': 2760,
    'fi': '65.94',
    'fk': '7.65',
    'word …
Continue reading “Post Statistics Plugin for Pelican”