0%

博客搭建

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

添加字数统计于阅读统计

1.安装hexo-wordcount插件

1
npm i --save hexo-wordcount

成功会在根目录下的package.json中多出"hexo-wordcount": "^6.0.1"

2.安装hexo-symbols-count-time

1
npm install hexo-symbols-count-time --save

3.安装eslint

1
npm install eslint --save

4.在站点配置文件添加如下配置

1
2
3
4
5
6
symbols_count_time:
symbols: true # 文章字数统计
time: true # 文章阅读时长
total_symbols: true # 站点总字数统计
total_time: true # 站点总阅读时长
exclude_codeblock: false # 排除代码字数统计

5.在主题配置文件中添加如下配置

1
2
3
4
5
6
7
symbols_count_time:
separated_meta: true # 是否另起一行(true的话不和发表时间等同一行)
item_text_post: true # 首页文章统计数量前是否显示文字描述(本文字数、阅读时长)
item_text_total: false # 页面底部统计数量前是否显示文字描述(站点总字数、站点阅读时长)
awl: 4 # Average Word Length
wpm: 275 # Words Per Minute(每分钟阅读词数)
suffix: mins.

6.Next主题添加字数统计和阅读统计
在主题配置文件做如下更改

1
2
3
4
5
6
post_wordcount: 		# 字数统计
item_text: true # 是否显示文字
wordcount: true # 显示字数
min2read: true # 显示阅读时间
totalcount: true # 显示总数
separated_meta: true # 是否分开