2

In my blog based on Jekyll I included a read estimation similar to the one on Medium. However I don't want it to include code blocks which I use a lot in the article. The snippet looks like this:

<span class="post-meta">
    {{ post.content | number_of_words | divided_by:180 }} min read
</span>

I already used strip_html but this did not remove the code blocks from counting.

Bonus if you also have suggestion to count the number of lines of code in the article so I would be able to post something similar to this:

<span class="post-meta">
    {{ post.content | number_of_words | ? | divided_by:180 }} min read and {{ ? }} lines of code
</span>
mostsignificant
  • 312
  • 1
  • 8

0 Answers0