• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    JavaScript
  • License
    GNU Lesser Genera...
  • Created almost 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Symbols count and time to read of articles for Hexo.

hexo-symbols-count-time

npm-image node-image hexo-image cover-image travis-image appveyor-image lic-image

Symbols count and time to read for articles in Hexo blog.

Better than hexo-reading-time and faster than hexo-wordcount. No external dependencies.

Installation

size-image dm-image dt-image

$ npm install hexo-symbols-count-time

Usage

You can set options of hexo-symbols-count-time in the Hexo's _config.yml (which locates in the root dir of your blog):

symbols_count_time:
  symbols: true
  time: true
  total_symbols: true
  total_time: true
  exclude_codeblock: false
  awl: 4
  wpm: 275
  suffix: "mins."

If symbols_count_time option is not specified, the default parameters will be used.

Parameters

  • awl – Average Word Length (chars count in word). Default: 4. You can check this here.
    • CN ≈ 2
    • EN ≈ 5
    • RU ≈ 6
  • wpm – Words Per Minute. Default: 275. You can check this here.
    • Slow ≈ 200
    • Normal ≈ 275
    • Fast ≈ 350
  • suffix – If time to read less then 60 minutes, added suffix as string parameter.
    If not defined, mins. will be used as default.
  • exclude_codeblock – Allow to exclude all content inside code blocks for more accurate words counting.
    If not defined, false will be used as default.

Note for Chinese users: because in Chinese language average word length about ~1.5 and if you at most cases write posts in Chinese (without mixed English), recommended to set awl to 2 and wpm to 300.
But if you usualy mix your posts with English, awl to 4 and wpm to 275 will be nice.

NexT theme

This plugin integrated in «NexT» and after plugin enabled in main Hexo config, you may adjust options in NexT config:

symbols_count_time:
  separated_meta: true
  item_text_post: true
  item_text_total: false

Development

$ cd hexo
$ git clone https://github.com/theme-next/hexo-symbols-count-time.git node_modules/hexo-symbols-count-time
$ cd node_modules/hexo-symbols-count-time

Tests

$ npm install mocha chai --save-dev
$ npm test

Tests with coverage

$ npm install -g nyc
$ nyc --print both node_modules/.bin/_mocha -- test/index.js

Templates

Symbols Count

{{ symbolsCount(post) }}

Symbols Time

{{ symbolsTime(post) }}

Or with predefined parameters:

{{ symbolsTime(post, awl, wpm, suffix) }}

Symbols Count Total

{{ symbolsCountTotal(site) }}

Symbols Time Total

{{ symbolsTimeTotal(site) }}

Or with predefined parameters:

{{ symbolsTimeTotal(site, awl, wpm, suffix) }}

Renderers syntax

SWIG / Nunjucks: {{ template }}
EJS: <%- template %>
Jade: span= template

More Repositories

1

hexo-theme-next

Elegant and powerful theme for Hexo.
Stylus
8,134
star
2

awesome-next

😎 Theme NexT, AWESOME NexT!
112
star
3

theme-next.org

The website for NexT.
Shell
58
star
4

theme-next-canvas-nest

canvas-nest.js for NexT.
53
star
5

hexo-filter-optimize

A Hexo plugin that optimize the pages loading speed.
JavaScript
45
star
6

hexo-generator-searchdb

Seach data generator plugin for Hexo.
JavaScript
44
star
7

hexo-leancloud-counter-security

A plugin to fix a serious security bug in leancloud visitor counter for NexT.
JavaScript
33
star
8

theme-next-three

JavaScript 3D library for NexT.
JavaScript
31
star
9

theme-next-pace

Loading bar for NexT.
29
star
10

theme-next-fancybox3

fancyBox3 for NexT.
JavaScript
26
star
11

hexo-next-utteranc

Utteranc.es comment system for NexT.
JavaScript
20
star
12

theme-next-pdf

PDF.js for NexT.
JavaScript
18
star
13

theme-next-needmoreshare2

NeedMoreShare2 for NexT.
CSS
16
star
14

theme-next-canvas-ribbon

canvas-ribbon.js for NexT.
JavaScript
14
star
15

theme-next-reading-progress

Reading Progress for NexT.
JavaScript
12
star
16

hexo-next-share

Content sharing services for NexT.
JavaScript
12
star
17

hexo-filter-emoji

🎉 GitHub emojis for Hexo!
JavaScript
11
star
18

theme-next-calendar

一个简洁的hexo-next日历云插件
JavaScript
10
star
19

theme-next-algolia-instant-search

Algolia Search for NexT.
9
star
20

theme-next-bookmark

Bookmark is a plugin that allow the users save their reading progress.
JavaScript
9
star
21

hexo-next-coauthor

Add coauthor post meta for NexT theme.
JavaScript
6
star
22

hexo-theme-next-anchor

A NexT plugin that adds an anchor to every heading.
JavaScript
6
star
23

hexo-pangu

Server side pangu.js filter for Hexo.
JavaScript
5
star
24

hexo-next-title

Dynamic page title for NexT.
JavaScript
3
star
25

theme-next-jquery-lazyload

Lazyload for NexT.
JavaScript
3
star
26

theme-next-fancybox

fancyBox2 for NexT.
JavaScript
3
star
27

next-util

Utilities for NexT.
JavaScript
1
star
28

hexo-next-exif

Exif.js for NexT.
JavaScript
1
star
29

hexo-front-matter-include

Include some front-matter from config or data file.
JavaScript
1
star
30

hexo-renderer-njks

Yet another Nunjucks renderer for Hexo.
JavaScript
1
star
31

performance-test

Scripts for theme performance test
Shell
1
star
32

hexo-next-tag

Tag plugins for NexT.
CSS
1
star