Fork me on GitHub

主题配置

目录

主题配置


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
## menu -- 导航菜单显示{[@page:名字,@url:地址,@icon:图标]}
menu:
- page: home
url: /
icon: fa-home

## favicon -- 网站图标位置{@favicon}
favicon: /favicon.ico

## rss --rss文件位置{@rss}
rss: /atom.xml


# 各个小工具的设置

## widgets -- 6个左边小工具{@widgets:[notification,category,archive,tagcloud,friends]}
widgets:
- search
- notification
- social
- category
- archive
- tagcloud
- friends

# 各个小工具的设置

## 搜索
jsonContent:
searchLocal: true // 是否启用本地搜索
searchGoogle: true //是否启用谷歌搜索
posts:
title: true
text: true
content: true
categories: false
tags: false

## notification config --网站公告设置,支持 html 和 纯文本
notification: |-
<p>主题已经上线!欢迎下载或更新~ <br/>
主题下载:<a href="https://github.com/shenliyang/hexo-theme-snippet" title="fork me" target="_blank">Snippet主题</a> <br/>
<hr/>接受贡献,包括不限于提交问题与需求,修复代码。欢迎Pull Request<br/>支持主题:<a href="https://github.com/shenliyang/hexo-theme-snippet/stargazers">Star一下</a></p>

## 社交设置{@name:社交工具名字,@icon:社交工具图标,@href:设置工具链接} [参考图标](http://fontawesome.io/icons/)
social:
- name: Github
icon: git
href: //github.com/shenliyang

## 文章分类设置{@cate_config:{@show_count:是否显示数字,@show_current: 是否高亮当前category}}
cate_config:
show_count: true
show_current: true

## 文章归档设置{@arch_config:/*参数参考:https://hexo.io/zh-cn/docs/helpers.html#list-archives*/}
## 推荐组合方式:[{type: 'monthly',format: 'YYYY年MM月'},{type: 'yearly',format: 'YYYY年'}]
arch_config:
type: 'monthly'
format: 'YYYY年MM月'
show_count: true
order: -1

## 标签云设置{/*参数参考:http://www.goat1000.com/tagcanvas-options.php */}
tagcloud:
tag3d: false // 是否启用3D标签云
textColour: '#444' // 字体颜色
outlineMethod: 'block' // 选中模式(outline|classic|block|colour|size|none)
outlineColour: '#FFDAB9' // 选中模式的颜色
interval: 30 // 动画帧之间的时间间隔,值越大,转动幅度越大
freezeActive: true // 选中的标签是否继续滚动
frontSelect: true // 不选标签云后部的标签
reverse: true // 是否反向触发
wheelZoom: false // 是否启用鼠标滚轮

## 友链设置{@链接名称:链接地址{@links:[,,,]}}
links:
- Hexo官网: https://hexo.io/zh-cn/


# 主题自定义个性化配置

## 网站宣传语{@branding:网站宣传语(不设置显示本地图片)}
branding: 从未如此简单有趣

## 设置banner背景图片{@img:自定义图片地址(支持绝对和相对路径),主题默认{"静态背景":"banner.jpg"},{"动态背景":"banner2.jpg"},{"动态星空背景":"banner3.jpg"}}
## 例如:http://snippet.shenliyang.com/img/banner|2|3.jpg, 或者 './img/banner-img.jpg'(相对本地资源地址)
banner:
img: http://snippet.shenliyang.com/img/banner.jpg


## 设置carousel{@img:图片地址,@url:点击跳转链接(默认值:"javascript:")}
carousel:
img: 'img/head-img.jpg'
url: 'javascript:'

## 首页列表底部面板{@homePanel: 是否开启}
homePanel: true

## 首页文章列表缩略图
### 加载规则: 自定义文章缩略图(在Front-matter中添加的'img'字段) > 文章内的图片 > defaultImgs(随机获取) > 无图模式列表

## 自定义随机图片
defaultImgs:
- http://www.example.jpg //远程图片链接示例
- /img/default-1.jpg //本地图片链接示例

### 文章摘要{@摘要显示优先级:自定义摘要 > 自动截取摘要 }
### 自定义摘要范围{@<!--more-->:截取more之前的内容为摘要}
### 自动截取摘要{@excerptLength:自动截取文章前多少个字为摘要,不配置默认:120字}
excerptLength: 120

## 是否开启文章目录
toc: true

## 代码高亮配置{@highlightTheme: 主题名称,(配置暂时不可用,后续开发中…)}

highlightTheme: default //TODO

## 文章过期提醒功能 {@warning:{days:临界天数(默认300天,设置0关闭功能),text:提醒文字/*%d为过期总天数占位符*/}}
warning:
days: 300
text: '本文于%d天之前发表,文中内容可能已经过时。'

## 文章内声明{@declaration: {enable:是否开启,title:声明标题,tip:提示内容}}
declaration:
enable: true
title: '转载声明'
tip: |-
商业转载请联系作者获得授权,非商业转载请注明出处 © <a href="" target="_blank">Snippet</a>

## 文章打赏{@reward: {alipay:支付宝打赏,wepay:微信打赏,tip:打赏提示语; 链接都为空,关闭打赏功能}}
reward:
alipay: ''
wepay: '../img/reward-wepay.jpg'
tip: 赞赏是不耍流氓的鼓励


## 主题评论

### gitment
gitment:
enable: false
owner:
repo:
client_id:
client_secret:
labels:
perPage:
maxCommentHeight:

### 来必力(默认选项)
livere:
enable: true
livere_uid:

### 友言评论(服务不稳定,经常无法加载)
uyan:
enable: false
uyan_id:

### Disqus评论(需要翻墙,或者搭建代理)
disqus:
enable: false
shortname: snippet
count: false

### 畅言评论(需要ICP备案)
changyan:
enable: false
appid:
conf:

### Valine评论 参考网站: [valine评论](https://valine.js.org/)
valine:
enable: true
appId:
appKey:
placeholder: 说点什么吧
notify: false // 邮件通知
verify: false // 验证码
avatar: mm // avatar头像
meta: nick,mail // 输入框内容,可选值nick,mail,link
pageSize: 10

## 网站访客统计 [不蒜子统计](http://busuanzi.ibruce.info/)
visit_counter:
site: true // 总访问量和访问人数统计
page: true // 文章阅读量统计

## 网站访问统计

### 网盟CNZZ统计 参考网站: [网盟CNZZ](http://www.umeng.com/)
cnzz_anaylytics:

### 百度统计 参考网站: [百度统计](https://tongji.baidu.com/)
baidu_anaylytics:

### 谷歌统计 参考网站:[谷歌统计](https://www.google-analytics.com/)
google_anaylytics:

### 腾讯分析 参考网站:[腾讯分析](http://ta.qq.com/)
tencent_analytics:

### 百度站点认证
baidu-site-verification:

### 百度自动推送(@baidu_push: 是否启用百度自动推送) 参考网站: [百度站长资源](https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title18)
baidu_push:

## ICON配置 (不配则启用本地Font Icon)
fontAwesome: //cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css

## 网站主题配置
since: 2017 //建站时间
robot: 'all' //控制搜索引擎的抓取和索引编制行为,默认为all
version: 1.2.1 //当前主题版本号
1
2
3
4
5
6
7
8
9
10
11
//编译生成静态页面
hexo g //generetor的缩写

//启动本地服务
hexo s //server的缩写

//开始部署
hexo d

//清除缓存文件
hexo clean

更多参考:https://hexo.io/zh-cn/docs/commands.html

微信打赏

赞赏是不耍流氓的鼓励

评论系统未开启,无法评论!