How to extract number of words (for time reading a post) in franklin.jl

I’m looking to improve my blog a bit with Franklin, and one thing I want to add to make it more user-friendly is something like the number of words and the approximate reading time (this as a simple calculation of proportion of the former) for each post.

So, I want to write a function hfun_wordcount() in utils.jl and then include it in each post. My question is, what function should I use to extract the corpus of this text?