diff --git a/README.md b/README.md index 8bc537612..e707cb8c2 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ show_category_count: false ## If you want to show the count of categories in the toc_number: true ## If you want to add list number to toc please set the value to true. shareto: false ## If you want to use the share button please set the value to true, you must have hexo-helper-qrcode installed. busuanzi: false ## If you want to use Busuanzi page views please set the value to true. +wordcount: false ## If you want to use wordcount views please set the value to true, and make sure hexo-wordcount is installed widgets_on_small_screens: false ## Set to true to enable widgets on small screens. canvas_nest: enable: false ## If you want to use dynamic background please set the value to true, you can also fill the following parameters to customize the dynamic effect, or just leave them blank to keep the default effect. @@ -86,7 +87,7 @@ post_copyright: enable: false ## If you want to display the copyright info after each post, please set the value to true and fill the following items on your need. author: ## Your author name, e.g. tufu9441 copyright_text: ## Your copyright text, e.g. The author owns the copyright, please indicate the source reproduced. - + menu: - page: home directory: . @@ -153,6 +154,7 @@ version: 0.0.0 - toc_number - Show the list number of toc - shareto - Enable share button, with the dependency on the plugin [hexo-helper-qrcode](https://github.com/yscoder/hexo-helper-qrcode) - busuanzi - Enable [Busuanzi](http://busuanzi.ibruce.info) page views +- wordcount - Enable [hexo-wordcount](https://www.npmjs.com/package/hexo-wordcount) page views - widgets_on_small_screens - Show the widgets at the bottom of small screens - [canvas_nest](https://github.com/hustcc/canvas-nest.js) - Enable dynamic background - donate - Enable donate button after each post diff --git a/_config.yml b/_config.yml index 7bce4a275..b306d97b5 100644 --- a/_config.yml +++ b/_config.yml @@ -39,6 +39,7 @@ show_category_count: false ## If you want to show the count of categories in the toc_number: true ## If you want to add list number to toc please set the value to true. shareto: false ## If you want to use the share button please set the value to true, you must have hexo-helper-qrcode installed. busuanzi: false ## If you want to use Busuanzi page views please set the value to true. +wordcount: false ## If you want to use wordcount views please set the value to true, and make sure that hexo-wordcount is installed widgets_on_small_screens: false ## Set to true to enable widgets on small screens. canvas_nest: enable: false ## If you want to use dynamic background please set the value to true, you can also fill the following parameters to customize the dynamic effect, or just leave them blank to keep the default effect. @@ -58,7 +59,7 @@ post_copyright: enable: false ## If you want to display the copyright info after each post, please set the value to true and fill the following items on your need. author: ## Your author name, e.g. tufu9441 copyright_text: ## Your copyright text, e.g. The author owns the copyright, please indicate the source reproduced. - + menu: - page: home directory: . diff --git a/languages/en.yml b/languages/en.yml index 856559a10..d0cb72c45 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -27,3 +27,5 @@ copyright_author_prefix: "Author: " copyright_link_prefix: "Blog Link: " copyright_declare_prefix: "Copyright Declaration: " copyright_default_text: "The author owns the copyright. Please indicate the source reproduced!" +word_cnt: Words +read_time: Minutes diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 2b472860d..07082f836 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -27,3 +27,5 @@ copyright_author_prefix: 本文作者: copyright_link_prefix: 本文链接: copyright_declare_prefix: 版权声明: copyright_default_text: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处! +word_cnt: 字 +read_time: 分钟 diff --git a/layout/_partial/wordcount.pug b/layout/_partial/wordcount.pug new file mode 100644 index 000000000..3b9f5f92d --- /dev/null +++ b/layout/_partial/wordcount.pug @@ -0,0 +1,11 @@ +span.post-time + span.post-meta-item-text= ' | ' + span.post-meta-item-icon + i(class="fa fa-keyboard-o") + span.post-count= ' '+wordcount(page.content) + span.post-meta-item-text= " "+__('word_cnt') +span.post-time= ' | ' + span.post-meta-item-icon + i(class="fa fa-hourglass-half") + span.post-count= ' '+min2read(page.content) + span.post-meta-item-text= ' '+__('read_time') diff --git a/layout/post.pug b/layout/post.pug index e405e2dcd..b6537cf68 100644 --- a/layout/post.pug +++ b/layout/post.pug @@ -17,6 +17,8 @@ block content span#busuanzi_container_page_pv= ' | ' span#busuanzi_value_page_pv span= ' ' + __('Hits') + if theme.wordcount == true + include _partial/wordcount.pug if theme.disqus a.disqus-comment-count(data-disqus-identifier=page.path, href=url_for(page.path) + '#disqus_thread') if theme.changyan