Preview
- Normal style
- With thumbnail
General Solution
update: Take images into account.
- Get the element which contains the paragraphs to be count.
- Use innerText.length to count.
- Get the parent container.
- Insert new elements to the end of the container.
Jump in!
notes: the present guide is only for the latest version of inside 2.7.0 beta0.
- create a new
js
file, and copy the following codes.
Defult by 400 words or 12 images per min.
Customize in line 4.
1 | var $container = $("[class='φgj φo']"); |
- put this file to your source folder
My demon uses the following path:
\source\custom\wordcount.js
- Edit the
_config.yml
in hexo root folder to skip render js file.
1 | skip_render: |
- Edit the
_config.yml
in theme folder to introduce.
\themes\inside\_config.yml
1 | plugins: |
notes: If you already introduced font-awesome,following code is removeable.
<link href="https://cdn.bootcss.com/font-awesome/5.13.0/css/all.min.css" rel="stylesheet">
- Save all changes and execute following commands in hexo root folder.
1 | hexo clean |
Preview changes in your browser. If work out well then execute:
1 | hexo d |
- Enjoy! XD