{"id":13614796,"url":"https://github.com/next-theme/hexo-word-counter","last_synced_at":"2025-04-07T16:18:40.692Z","repository":{"id":40562315,"uuid":"262552890","full_name":"next-theme/hexo-word-counter","owner":"next-theme","description":"⏱️ Word count and time to read of articles for Hexo, written in Rust","archived":false,"fork":false,"pushed_at":"2025-03-21T22:26:12.000Z","size":71,"stargazers_count":35,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T12:08:24.695Z","etag":null,"topics":["hexo","hexo-plugin","word-count"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/hexo-word-counter","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/next-theme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-09T11:09:25.000Z","updated_at":"2025-03-24T01:34:04.000Z","dependencies_parsed_at":"2023-11-17T23:56:32.649Z","dependency_job_id":"4858e71d-1d47-4919-9977-3303cdfd90de","html_url":"https://github.com/next-theme/hexo-word-counter","commit_stats":{"total_commits":54,"total_committers":4,"mean_commits":13.5,"dds":"0.40740740740740744","last_synced_commit":"321accd0d27574eafcef6e5c5aef9d84c72a7793"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-word-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-word-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-word-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-theme%2Fhexo-word-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/next-theme","download_url":"https://codeload.github.com/next-theme/hexo-word-counter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hexo","hexo-plugin","word-count"],"created_at":"2024-08-01T20:01:05.751Z","updated_at":"2025-04-07T16:18:40.651Z","avatar_url":"https://github.com/next-theme.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Hexo Plugins"],"readme":"# Hexo Word Counter\n\n[![Build Status][github-image]][github-url]\n[![npm-image]][npm-url]\n[![hexo-image]][hexo-url]\n[![lic-image]](LICENSE)\n\nWord count and time to read for articles in Hexo blog.\n\nThe word count is based on [Unicode® Standard Annex #29](https://www.unicode.org/reports/tr29/). Thus, when multiple languages are present in the post content, the total word count can be accurately counted.\n\nWith the power of Rust, this plugin is faster than almost all other Hexo plugins that offer similar functionality. See the [benchmark](#Benchmark) below.\n\n## Installation\n\n![size-image]\n[![dm-image]][npm-url]\n[![dt-image]][npm-url]\n\n```bash\nnpm install hexo-word-counter\nhexo clean\n```\n\n## Usage\n\nYou can set options of hexo-word-counter in the **Hexo's `_config.yml`** (which locates in the root dir of your blog):\n\n```yml\nsymbols_count_time:\n  symbols: true\n  time: true\n  total_symbols: true\n  total_time: true\n  exclude_codeblock: false\n  wpm: 275\n  suffix: \"mins.\"\n```\n\nIf `symbols_count_time` option is not specified, the default parameters will be used.\n\n### Parameters\n\n* `wpm` – Words Per Minute. Default: `275`. You can check this [here](https://wordcounter.net).\n  * Slow \u0026asymp; `200`\n  * Normal \u0026asymp; `275`\n  * Fast \u0026asymp; `350`\n* `suffix` – If time to read less then 60 minutes, added suffix as string parameter.\\\n  If not defined, `mins.` will be used as default.\n* `exclude_codeblock` – Allow to exclude all content inside code blocks for more accurate words counting.\\\n  If not defined, `false` will be used as default.\n\n**Note for Chinese users:** if you write posts in Chinese at most cases (without mixed English), recommended to set `wpm` to `300`.\\\nBut if you usually mix your posts with English, set `wpm` to `275` will be nice.\n\n### For NexT Theme\n\nThis plugin integrated in «NexT» and after plugin enabled in main Hexo config, you may adjust options in NexT config:\n\n```yml\npost_meta:\n  item_text: true\n\nsymbols_count_time:\n  separated_meta: true\n  item_text_total: false\n```\n\n## Development\n\nYou have to prepare both Node.js and rust toolchain to develop this plugin.\n\n```bash\ngit clone https://github.com/next-theme/hexo-word-counter.git\ncd hexo-word-counter\nnpm install\n```\n\nYou can run tests with or without coverage feedback:\n\n```bash\nnpm test\nnpm run test-cov\n```\n\nAnd you can install the development version in your blog:\n\n```bash\ncd blog\nnpm i ../path/to/hexo-word-counter\n```\n\n## Theme Integration\n\nIf you're a theme developer, you can use the following code to integrate this plugin.\n\n### Word Count\n\nThe syntax is different depending on the templating engine of the theme.\n\nFor Nunjucks / Swig:\n```\n{{ symbolsCount(post) }}\n```\n\nFor Ejs:\n```\n\u003c%- symbolsCount(post) %\u003e\n```\n\nFor Pug / Jade:\n```\nspan=symbolsCount(post)\n```\n\nIn the latter part, we use Nunjucks syntax as an example.\n\n### Post Reading Time\n\n```\n{{ symbolsTime(post) }}\n```\n\nOr with predefined parameters:\n\n```\n{{ symbolsTime(post, awl, wpm, suffix) }}\n```\n\n### Total Word Count\n\n```\n{{ symbolsCountTotal(site) }}\n```\n\n### Total Post Reading Time\n\n```\n{{ symbolsTimeTotal(site) }}\n```\n\nOr with predefined parameters:\n\n```\n{{ symbolsTimeTotal(site, awl, wpm, suffix) }}\n```\n\n## Benchmark\n\nSee [GitHub actions](https://github.com/next-theme/hexo-word-counter/actions/runs/3391961808/jobs/5637627050).\n\n| Plugin installed | Time of `hexo g` |\n| - | - |\n| Baseline | 19.48s |\n| hexo-word-counter | 19.63s (+0.78%) |\n| [hexo-symbols-count-time](https://github.com/theme-next/hexo-symbols-count-time) | 19.86s (+1.99%) |\n| [hexo-wordcount](https://github.com/willin/hexo-wordcount) | 21.44s (+10.08%) |\n| [hexo-reading-time](https://github.com/ierhyna/hexo-reading-time) | 23.81s (+22.26%) |\n\n[github-image]: https://img.shields.io/github/actions/workflow/status/next-theme/hexo-word-counter/linter.yml?branch=main\u0026style=flat-square\n[npm-image]: https://img.shields.io/npm/v/hexo-word-counter?style=flat-square\n[hexo-image]: https://img.shields.io/badge/hexo-%3E%3D%203.0-blue?style=flat-square\n[cover-image]: https://img.shields.io/coveralls/next-theme/hexo-word-counter/master?style=flat-square\n[lic-image]: https://img.shields.io/npm/l/hexo-word-counter?style=flat-square\n\n[size-image]: https://img.shields.io/github/languages/code-size/next-theme/hexo-word-counter?style=flat-square\n[dm-image]: https://img.shields.io/npm/dm/hexo-word-counter?style=flat-square\n[dt-image]: https://img.shields.io/npm/dt/hexo-word-counter?style=flat-square\n\n[github-url]: https://github.com/next-theme/hexo-word-counter/actions?query=workflow%3ALinter\n[npm-url]: https://www.npmjs.com/package/hexo-word-counter\n[hexo-url]: https://hexo.io\n[cover-url]: https://coveralls.io/github/next-theme/hexo-word-counter?branch=master \"Coverage of Tests\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-theme%2Fhexo-word-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnext-theme%2Fhexo-word-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-theme%2Fhexo-word-counter/lists"}