Hexo文章計(jì)數(shù)插件WordCount

靈感來自簡書。

字?jǐn)?shù)統(tǒng)計(jì)的結(jié)果跟簡書有差異,主要是由于本插件只統(tǒng)計(jì)了中文字?jǐn)?shù)和英文單詞數(shù),所以結(jié)果會(huì)比簡書統(tǒng)計(jì)的字?jǐn)?shù)略少一些。

特別適合文字愛好者,比如我。

項(xiàng)目地址: https://npmjs.org/package/hexo-wordcount

安裝和使用

安裝

npm i --save hexo-wordcount

使用

修改Themes模板文件,在Post文章模板區(qū)域加入:

<span class="post-count">{{ wordcount(post.content) }}</span>

即可統(tǒng)計(jì)單篇文章的字?jǐn)?shù)。

<span class="post-count">{{ totalcount(site) }}</span>

上面這句是統(tǒng)計(jì)總字?jǐn)?shù)的,可以放到Footer或其他位置里。


A Word Count plugin for Hexo.

Installation and Usage

Install

npm install hexo-wordcount --save

Post Count:

<span class="post-count">{{ wordcount(post.content) }}</span>

Total Count:

<span class="post-count">{{ totalcount(site) }}</span>

LICENSE

MIT

原文鏈接:http://blog.willin.wang/posts/2015/hexo-wordcount/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容