Quartz初浅使用

1、Quartz 简介

本教程建立在**SSM**整合点**Maven**项目的商城网站上 实现概览:通过提交商品订单,限制用户在规定时间付款,若仍未付款达到规定时间取消订单动作。


  • 官方介绍

Quartz 是 OpenSymphony 开源组织在 Job scheduling 领域又一个开源项目,它可以与 J2EE 与 J2SE 应用程序相结合也可以单独使用。Quartz 可以用来创建简单或为运行十个,百个,甚至是好几万个 Jobs 这样复杂的程序。Jobs 可以做成标准的 Java 组件或  EJBs。 Quartz 用一个小 Java 库发布文件(.jar 文件),这个库文件包含了所有 Quartz 核心功能。这些功能的主要接口(API)是 Scheduler 接口。它提供了简单的操作,例如:将任务纳入日程或者从日程中取消,开始/停止/暂停日程进度。

2、下载及其安装

2.1 下载

官方 Site: http://www.quartz-scheduler.org

Click 下 Download 即可下载最新 这里显示最新为 2.2.3

2.2 添加 Maven 依赖

一般使用 Quartz 以及 Spring4 框架整合使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.3</version>
</dependency>

和 Spring 整合,需要 spring-context-support 的 jar 包

3、简单剖析

Quartz 框架简单架构

  1. Schedule ——  核心调度器
  2. Job ——  任务
  3. JobDetail ——  执行任务器
  4. Tigger ——  触发器

使用方法:

  1. 制作一个任务 Job java 类 需要一个执行方法
  2. 将类放到 spring 容器内,注意需要注解
  3. 配置 jobDetail,指定相应的任务 job
  4. 配置一个 Tigger,编写一个由 corn 表达式的触发方法的触发器
  5. 配置一个配置调度工厂

执行流程图:

4、使用教程

4.1 创建一个 Job Java 类

值得注意需要声明 execute()

1
2
3
4
5
6
7
8
public class Scheduler1 {
public void execute()
{
System.out.println("The task has been completed...");
System.out.println("Tasks to complete!");
System.out.println(new Date());
}
}

4.2 配置 Spring

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!-- 配置job类 -->
<bean id="scheduler1" class="com.hmall.order.schedule.Scheduler1"></bean>
<!-- 配置JobDetail执行任务器 -->
<bean id="SpringQtzJobMethod"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="scheduler1"></ref> <!-- 要执行的job名称 -->
</property>
<property name="targetMethod"> <!-- 要执行的方法名称 -->
<value>execute</value>
</property>
</bean>
<!-- 配置Trigger调度触发器 -->
<bean id="CronTriggerBean"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="SpringQtzJobMethod"></property>
<property name="cronExpression" value="0/5 * * * * ?"></property>
</bean>
<!-- 配置调度工厂 -->
<bean id="SpringJobSchedulerFactoryBean"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="CronTriggerBean"></ref>
</list>
</property>
</bean>

值得注意:

1. job:scheduler1 – jobDetail:scheduler1 job:SpringQtzJobMethod – Trigger:SpringQtzJobMethod Trigger:CronTriggerBean – FactoryBean:CronTriggerBean

2.需要使用 corn 表达式

4.3 运行调试

运行 Maven 项目  clean tomcat7:run

1
2
3
4
5
DEBUG - Calling execute on job DEFAULT.SpringQtzJobMethod
DEBUG - batch acquisition of 1 triggers
The task has been completed...
Tasks to complete!
Wed Jun 20 11:46:20 CST 2018

看到以上 success 即成功

5、Corn 表达式

Cron 表达式的说明

字段名 允许的值 允许的特殊字符
0-59 , - * /
0-59 , - * /
0-23 , - * /
1-31 , - * ? / L W C
1-12 or JAN-DEC , - * /
1-7 or SUN-SAT , - * ? / L C #
empty, 1970-2099 , - * /

Cron字符的说明

字符名 字符说明
“?”字符 表示不确定的值
“,”字符 指定数个值
“-”字符 指定一个值的范围
“/”字符 指定一个值的增加幅度。n/m 表示从 n 开始,每次增加 m
“L”字符 用在日表示一个月中的最后一天,用在周表示该月最后一个星期 X
“W”字符 指定离给定日期最近的工作日(周一到周五)
“#”字符 表示该月第几个周 X。6#3 表示该月第 3 个周五

Cron 常用表达式案例说明

表达式 含义
0 0 12 ? 每天中午 12 点触发
0 15 10 ? 每天上午 10:15 触发
0 15 10 ? 每天上午 10:15 触发
0 15 10 ? * 每天上午 10:15 触发
0 15 10 ? 2005 年的每天上午 10:15 触发
0 *14 ** ? 在每天下午 2 点到下午 2:59 期间的每 1 分钟触发
0 0/5 14 ? 在每天下午 2 点到下午 2:55 期间的每 5 分钟触发
0 0/5 14,18 ? 在每天下午 2 点到 2:55 期间和下午 6 点到 6:55 期间的每 5 分钟触发
0 0-5 14 ? 在每天下午 2 点到下午 2:05 期间的每 1 分钟触发
0 10,44 14 ? 3 WED 每年三月的星期三的下午 2:10 和 2:44 触发
0 15 10 ? * MON-FRI 周一至周五的上午 10:15 触发
0 15 10 15 * ? 每月 15 日上午 10:15 触发
0 15 10 L * ? 每月最后一日的上午 10:15 触发
0 15 10 ? * 6L 每月的最后一个星期五上午 10:15 触发
0 15 10 ? * 6L 2002-2005 2002 年至 2005 年的每月的最后一个星期五上午 10:15 触发
0 15 10 ? * 6#3 每月的第三个星期五上午 10:15 触发

Cron 表达式构造器

Site: http://cron.qqe2.com

Jar 软件: CronExpBuilder-1.0

在Icarus主题下开启评论模块

Valine

Valine评论插件的漏洞会导致此评论服务暴露所有评论者的IP地址 ([xCss/Valine#336](https://github.com/xCss/Valine/issues/336)) 请更换其他评论服务

何为 valine 评论?

Valine 诞生于 2017 年 8 月 7 日,是一款基于 LeanCloud 的快速、简洁且高效的无后端评论系统。 理论上支持但不限于静态博客,目前已有 Hexo、Jekyll、Typecho、Hugo、Ghost 等博客程序在使用 Valine。

和其他评论模块的优势

  • 属于国内的评论模块,在网站加载速度和人性化方面略优
  • LeanCloud 背书,有一定保障性
  • 无意义上后端,接入便捷
  • MarkDown 全语法支持,并支持Emoji

注册 LeanCloud 并创建应用

注册 LeanCloud 成功后创建应用

点击设置-应用 Key 获得 App key 即创建成功,由于 LeanCloud 对免费用户开发版进行一系列限制,接下来开始对该应用进行设置。

设置 - API 访问域名

绑定自己已有在国内备案过的域名,在设置-域名绑定-API 访问域名设置。

  • 注意不可以填入自己的 GitHub page 的 URL,github.io 也不行会引起 403 ERROR
  • 国际版可以使用免费的二级域名,这里不推荐使用,因为体验过后不太佳,尽量还是使用自有域名

设置 - 云引擎、ClientEngine 域名

同上,绑定域名,显示已绑定即成功绑定。

配置 Icarus 的 config

打开部署的 Hexo 根目录,在 theme 下的 Icarus 文件夹里vi _config.yml开始配置配置项,示例如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Comment plugin configurations
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Comment/
comment:
type: valine
app_id: W3zVbpO*****gzGzoHsz
app_key: DUKL************Lb1hNyD5q3
placeholder: "欢迎留言…"
notify: false
verify: false
avatar: 'retro'
meta: ["nick", "mail"]
page_size: 10
highlight: true
record_ip: false

附带 - 参数解释

参数 配置 说明
type changyan,disqus,disqusjs,facebook,gitalk,gitment,isso,livere,utterances,valine [必填] 这里默认 valine
app_id W3zVbpO*****gzGzoHsz [必填] 为 LeanCloud 应用的 AppID
app_key DUKL************Lb1hNyD5q3 [必填] 为 LeanCloud 应用的 AppKey
placeholder 欢迎留言… [可选] 评论前提示语
notify false [可选]notify 邮件提醒无论 true 和 false 都是不生效的,因为 valine 评论自带的邮件提醒功能将在 v1.4.0 发布时下线
verify false [可选]评论时是否有验证码,如为 true 需要在 Leancloud 设置->安全中心 中打开图形验证码服务
avatar mp,identicon,monsterid,wavatar,retro,robohash,hide [可选]评论发表时,不填入邮箱 email 或无Gravatar 头像显示的头像类型,详细见Valine 针对 avatar 头像的说明
meta [“nick”, “mail”, “link”] [可选]分别对应评论栏所供填入的昵称、邮箱地址和个人网站
page_size 10 [可选]分页配置
highlight true [可选]是否开启高亮代码
record_ip false [可选]是否评论后显示 IP

至此,键入hexo clen & g重启服务即可看到评论模块生效成功。

申请推送流服务

QMsg

因某些原因,Qmsg 酱将要停业,并关闭新用户登录通道,原有用户可以继续使用到完全停业。感谢您一直以来对 Qmsg 酱的支持!

由于 QMsg 已经关闭注册入口,现在新增国内另外一家提供推送消息服务 ServerChan

ServerChan

「Server 酱」,英文名「ServerChan」,是一款「程序员」和「服务器」之间的通信软件。

说人话?就是从服务器推报警和日志到手机的工具。

进入ServerChan官网,按流程注册获取到SCKEY,在下方测试正常推送到关注好到微信公众号收到测试消息,即可成功。

安装 Valine-admin

首先确保上面流程走完且评论正常,方可展开 valine 后台部署,然后进入 LeanCloud 对应的应用,点击 云引擎 -> 部署 -> 部署项目 -> Git 部署 -> Git 配置 填写 GIt 代码库并保存:[https://github.com/sviptzk/Valine-Admin-Server](https://github.com/sviptzk/Valine-Admin-Server) 然后再次点击 Git 部署 第一次部署请勾选不使用缓存,最后点击部署,查看日志无报错且部署完成就此部署第一阶段完成。

配置部署后台的环境变量

点击 云引擎 -> 设置 -> 添加新变量:

变量名 示例 说明
SITE_NAME My_blog [必填] 网站名称
SITE_URL https:/bk.catooilg.com [必填] 网站地址,最后不要加 /
SMTP_USER postmaster@catooilg.com [必填] SMTP 服务用户名,一般为邮箱地址。
SMTP_PASS password [必填] SMTP 密码,一般为授权码或者是邮箱的登陆密码,请自行查询对应邮件服务商的获取方式
SMTP_SERVICE qiye.aliyun 邮件服务提供商,请查询对应到邮件服务商参数
填入
SENDER_NAME Yuki [必填] 寄件人名称。
TEMPLATE_NAME default [必填] 设置提醒邮件的主题,默认为
default,可以选择填入 default,rainbow,custom1,custom2
DISABLE_EMAIL true [可选],填写则代表停止发送邮件
SCKEY xxx [可选] 填入 ServerChan 的 SCKEY
FAVICON https://img.catooilg.com/catooilg/2016/07/valine_favicon.ico [可选] 网页 favicon 图标

添加完成后,点击保存,并且重新部署实例即可。

初始化后台管理

第一次打开绑定的域名会提示需要登录,在域名后补上 /sign-up,先注册你的登录信息,即可进入后台进行管理操作。

设置防休眠

点击 云引擎 -> 定时任务,新增定时器,配置如图所示:

保存后运行即可。

常见问题

Q:提示 undefined is not a valid value

自定义环境变量没有配置好,请再次检查

Q:提示 Invalid status code: { favicon: ‘https://cdn.jsdelivr.net/gh/sviptzk/StaticFile_HEXO@v3.2.3/butterfly/img/favicon.ico‘ }

自定义环境变量网页 favicon 图标没有配置好,注意是否 ico 图标(尺寸为 48 × 48)

Waline

✖ Project framework failed to execute:

ERROR:

Please provide existed ossBucket under your account when code size is greater than 50M.

致谢与引用声明

Hexo 优化 — Valine 扩展之邮件通知

Valine 评论之 Valine-admin 配置攻略

Valine 官方文档

Qmsg 酱-您的专属 QQ 消息推送服务小姐姐

Server 酱 | 网站小帮手

部署Hexo博客

初次见面:

Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。


准备事项:

  • 自有服务器
  • 前端静态资源存储器,诸如Gitee Pages/Github Page 等

参考文章:

hexo 官方中文文档

于 CentOS 部署 hexo****

Hexo 是一个基于 nodejs 的静态博客网站生成器,作者是来自台湾的 Tommy Chen 一道指令即可快速生成支持 Markdown 的静态博客

部署程序

1.1 安装 NVM (可选)

wget -qO- [https://raw.github.com/creationix/nvm/master/install.sh](https://raw.github.com/creationix/nvm/master/install.sh) | sh

1.2 安装 Nodejs

nvm install stable

亦或者官网下载部署安装,检查是否安装成功

node -vnpm -v

1.3 下载与安装 Hexo

npm install -g hexo-cli

下载完毕中会告知你下载路径存放点,接着需要软链接一下

ln -s /usr/local/lib/node_modules/hexo-cli/bin/hexo /data/wwwroot/hexo

或者直接运行

hexo init

运行后会在你当前敲入命令的目录部署 hexo 代码,所以请确认好路径

随后清空缓存

hexo clean

生成静态

hexo g

hexo s

到此提示访问 URL 即可安装完毕

1.4 配置 Nginx

安装并部署 Nginx 有一点需要注意 root /root/hexos/public; 一定到部署 hexo 下级的 public

命令附录:

初始化:hexo init && npm install

生成博客:hexo g

部署博客:hexo d

清空缓存:hexo clean

启动本地服务器:hexo s

组合命令:hexo clean && hexo g -d

目录结构其下:

|

├── _config.yml            # 网站配置文件

├── .gitignore             # Git 忽略文件

├── node_modules           # 插件安装目录

├── package.json           # 描述插件

├── package-lock.json      # 描述插件 更详细

├── scaffolds              # 模板

├── source                 # 资源

└── themes                 # 主题

Hexo 配置项:

网站配置文件网站 配置文件:_config.yml ,官方配置文档传送门:配置 | Hexo

修改主题类型 配置文件:_config.yml 更改 theme: pure

1.5 美化 Hexo

这里我说明使用的模版主题为 icarus 当然可以选择 hexo 的主题列表挑选https://hexo.io/themes/

进入安装好的根目录/theme 下

git clone [https://github.com/ppoffice/hexo-theme-icarus.git](https://github.com/ppoffice/hexo-theme-icarus.git) themes/icarus

下载完成之后需要修改配置在 blog 文件夹下 _config.yml 文件 所有配置基本都在这里 找到 theme: landscape 修改为 theme: icarus 重启 hexo 服务即可

1.6 常见问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
❯ hexo server
INFO =======================================
██╗ ██████╗ █████╗ ██████╗ ██╗ ██╗███████╗
██║██╔════╝██╔══██╗██╔══██╗██║ ██║██╔════╝
██║██║ ███████║██████╔╝██║ ██║███████╗
██║██║ ██╔══██║██╔══██╗██║ ██║╚════██║
██║╚██████╗██║ ██║██║ ██║╚██████╔╝███████║
╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
=============================================
INFO === Checking package dependencies ===
ERROR Package bulma-stylus is not installed.
ERROR Package hexo-component-inferno is not installed.
ERROR Package hexo-renderer-inferno is not installed.
ERROR Package inferno is not installed.
ERROR Package inferno-create-element is not installed.
ERROR Please install the missing dependencies your Hexo site root directory:
ERROR npm install --save bulma-stylus@0.8.0 hexo-component-inferno@^0.4.0 hexo-renderer-inferno@^0.1.3 inferno@^7.3.3 inferno-create-element@^7.3.3
ERROR or:
ERROR yarn add bulma-stylus@0.8.0 hexo-component-inferno@^0.4.0 hexo-renderer-inferno@^0.1.3 inferno@^7.3.3 inferno-create-element@^7.3.3

如图所示,依照提示 npm 安装依赖重新启动 hexo 服务即可

npm install --save bulma-stylus@0.8.0 hexo-component-inferno@^0.4.0 hexo-renderer-inferno@^0.1.3 inferno@^7.3.3 inferno-create-element@^7.3.3

当然外国网速不好可以选择 cnpm

附带配置项说明:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# Version of the Icarus theme that is currently used
version: 2.6.0
# 你的网站图标,可以搜索在线图标制作,并将其放在images文件夹中
favicon: /images/favicon.svg
# Additional HTML meta tags in an array.
meta:
# Path or URL to RSS atom.xml
rss: /atom.xml
# 显示在导航栏左侧的网站logo,同样可以自己制作
logo: /images/hxx.jpg
# Open Graph metadata
# https://hexo.io/docs/helpers.html#open-graph
open_graph:
# Facebook App ID
fb_app_id:
# Facebook Admin ID
fb_admins:
# Twitter ID
twitter_id:
# Twitter site
twitter_site:
# Google+ profile link
google_plus:
# Navigation bar link settings
navbar:
#菜单(显示名称:对应文件夹)
menu:
主页: /
归档: /archives
分类: /categories
标签: /tags
关于: /about
# 导航栏右侧图标链接
links:
My GitHub:
icon: fab fa-github
url: 'https://github.com/h2pl/'
# Footer section link settings
footer:
# 页脚图标链接
links:
Creative Commons:
icon: fab fa-creative-commons
url: 'https://creativecommons.org/'
Attribution 4.0 International:
icon: fab fa-creative-commons-by
url: 'https://creativecommons.org/licenses/by/4.0/'
Download on GitHub:
icon: fab fa-github
url: 'https://github.com/ppoffice/hexo-theme-icarus'
# 文章显示设置
article:
#代码主题atom-one-light亮色,atom-one-dark暗色
highlight:
# Code highlight themes
# https://github.com/highlightjs/highlight.js/tree/master/src/styles
theme: atom-one-dark
# Show code copying button
clipboard: true
# Default folding status of the code blocks. Can be "", "folded", "unfolded"
fold: unfolded
# 是否显示文章主图
thumbnail: true
# 是否显示估算阅读时间
readtime: true
# 搜索插件设置
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Search
search:
# Name of the search plugin
type: insight
# 评论插件设置
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Comment
comment:
#可选valine,disqus(科学上网)等
# Name of the comment plugin
avatar: retro # Gravatar style : mm/identicon/monsterid/wavatar/retro/hide
placeholder: 要不要说点啥... # Comment Box placeholder
type: valine
shortname: 黄小斜
# 打赏功能
# https://ppoffice.github.io/hexo-theme-icarus/categories/Donation/
donate:
-
# 阿里巴巴支付宝
type: alipay
# 二维码图片
qrcode: '/images/hxx.jpg'
-
# 微信
type: wechat
# 二维码图片
qrcode: '/images/hxx.jpg'

# 分享插件设置
# https://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Share
share:
# Share plugin name
type: sharejs
# Sidebar settings.
# Please be noted that a sidebar is only visible when it has at least one widget
sidebar:
# 左侧边栏设置
left:
# 是否不随页面滚动
# https://ppoffice.github.io/hexo-theme-icarus/Configuration/Theme/make-a-sidebar-sticky-when-page-scrolls/
sticky: false
# right sidebar settings
right:
# 是否不随页面滚动
# https://ppoffice.github.io/hexo-theme-icarus/Configuration/Theme/make-a-sidebar-sticky-when-page-scrolls/
sticky: false
# 边栏小部件设置
# https://ppoffice.github.io/hexo-theme-icarus/categories/Widgets/
widgets:
-
# Widget name
type: profile
# Where should the widget be placed, left or right
position: left
# Author name to be shown in the profile widget
author: 黄小斜
# Title of the author to be shown in the profile widget
author_title: 蚂蚁金服Java工程师
# Author's current location to be shown in the profile widget
location: 浙江 杭州
# Path or URL to the avatar to be shown in the profile widget
avatar: /images/gzh.jpg
# Email address for the Gravatar to be shown in the profile widget
gravatar:
# Whether to show avatar image rounded or square
avatar_rounded: false
# 关注我的链接,可设为你的GitHub主页
follow_link: 'https://github.com/h2pl/'
# 个人介绍部件底部图标社交链接
social_links:
Github:
icon: fab fa-github
url: 'https://github.com/h2pl'
RSS:
icon: fas fa-rss
url: /
-
# Widget name
type: toc
# Where should the widget be placed, left or right
position: left
-
# Widget name
type: links
# Where should the widget be placed, left or right
position: left
# Links to be shown in the links widget
links:
CSDN: 'https://blog.csdn.net/a724888'
知乎: 'https://www.zhihu.com/people/h2pl/activities'
简书: 'https://www.zhihu.com/people/h2pl/activities'
-
# Widget name
type: category
# Where should the widget be placed, left or right
position: left
-
# Widget name
type: tagcloud
# Where should the widget be placed, left or right
position: left
-
# Widget name
type: recent_posts
# Where should the widget be placed, left or right
position: right
-
# Widget name
type: archive
# Where should the widget be placed, left or right
position: right
-
# Widget name
type: tag
# Where should the widget be placed, left or right
position: right
# Other plugin settings
plugins:
# Enable page animations
animejs: true
# Enable the lightGallery and Justified Gallery plugins
# https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/gallery-plugin/
gallery: true
# Enable the Outdated Browser plugin
# http://outdatedbrowser.com/
outdated-browser: true
# Enable the MathJax plugin
# https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/mathjax-plugin/
mathjax: true
# Show the back to top button on mobile devices
back-to-top: true
# Google Analytics plugin settings
# https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/site-analytics-plugin/#Google-Analytics
google-analytics:
# Google Analytics tracking id
tracking_id:
# Baidu Analytics plugin settings
# https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/site-analytics-plugin/#Baidu-Analytics
baidu-analytics:
# Baidu Analytics tracking id
tracking_id: 2289335dd443797b5867abbd156e7575
# Hotjar user feedback plugin
# https://ppoffice.github.io/hexo-theme-icarus/Plugins/General/site-analytics-plugin/#Hotjar
hotjar:
# Hotjar site id
site_id:
# Show a loading progress bar at top of the page
progressbar: true
# BuSuanZi site/page view counter
# https://busuanzi.ibruce.info
busuanzi: true
busuanzi:
enable: true
# CDN provider settings
# https://ppoffice.github.io/hexo-theme-icarus/Configuration/Theme/speed-up-your-site-with-custom-cdn/
# Show PV/UV of the website/page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
# count values only if the other configs are false
enable: true
# custom uv span for the whole site
site_uv: true
site_uv_header: 访客数
site_uv_footer: 人
# custom pv span for the whole site
site_pv: true
site_pv_header: 总访问量
site_pv_footer: 次
# custom pv span for one page only
page_pv: true
page_pv_header: <i class="fa fa-file-o"></i> 阅读数
page_pv_footer:

providers:
# Name or URL of the JavaScript and/or stylesheet CDN provider
cdn: jsdelivr
# Name or URL of the webfont CDN provider
fontcdn: google
# Name or URL of the webfont Icon CDN provider
iconcdn: fontawesome