Skip to content

Instantly share code, notes, and snippets.

@zhonger
Created December 20, 2021 07:20
Show Gist options
  • Save zhonger/9a26aed1141880ce03c1d27c61be5cdd to your computer and use it in GitHub Desktop.
Save zhonger/9a26aed1141880ce03c1d27c61be5cdd to your computer and use it in GitHub Desktop.
Calculate the number of letters in one post of Jekyll and the appropriate time if read it all.
<div class="post-meta">
<span>本文总共 {{ page.content | strip_html | strip_newlines | remove: " " | size }} 字 <b>·</b> 阅读全文大约需要 {{ page.content | strip_html | strip_newlines | remove: " " | size | divided_by: 350 | plus: 1 }} 分钟</span>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment