此爲本人在GitHub上搭建個人部落格的操作過程,過程很艱辛,結果很美好,一天時間總算沒有白費。Docker化操作見blog 『Using Docker Container To Auto Deploy Blog To GitHub Pages

Preparartion

Hexo需要使用npm安裝,而npmNode.js的包管理器,已經預置在Node.js

故安裝Hexo之前,操作系統上須已經安裝有Git, Node.js環境。

Software Official Website
CentOS7 https://www.centos.org/
Git https://github.com/git/git
Node.js https://nodejs.org/en/

系統相關信息

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$ date -R
Thu, 21 Jan 2016 12:56:44 +0800
$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
$ uname -r
3.10.0-327.4.4.el7.x86_64
$ git --version
git version 2.7.0
$ node --version
v5.4.0
$ npm --version
3.3.12
$

Install Hexo

執行命令

1
sudo npm install hexo-cli -g

注意:需要使用root權限運行npm install命令,否則會出現如下報錯

1
2
3
4
5
6
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
...
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
...
npm ERR! Please try running this command again as root/Administrator.

操作過程

 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
$ sudo npm install hexo-cli -g
[sudo] password for flying:
npm WARN install Couldn't install optional dependency: Unsupported
/usr/bin/hexo -> /usr/lib/node_modules/hexo-cli/bin/hexo
/usr/lib
└─┬ [email protected]
  ├── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ ├── [email protected]
  │ │ │ └─┬ [email protected]
  │ │ │   ├─┬ [email protected]
  │ │ │   │ └── [email protected]
  │ │ │   ├── [email protected]
  │ │ │   ├─┬ [email protected]
  │ │ │   │ ├─┬ [email protected]
  │ │ │   │ │ └─┬ [email protected]
  │ │ │   │ │   ├── [email protected]
  │ │ │   │ │   ├── [email protected]
  │ │ │   │ │   ├── [email protected]
  │ │ │   │ │   └── [email protected]
  │ │ │   │ ├── [email protected]
  │ │ │   │ └── [email protected]
  │ │ │   ├── [email protected]
  │ │ │   ├── [email protected]
  │ │ │   ├── [email protected]
  │ │ │   ├─┬ [email protected]
  │ │ │   │ └── [email protected]
  │ │ │   ├── [email protected]
  │ │ │   ├─┬ [email protected]
  │ │ │   │ ├─┬ [email protected]
  │ │ │   │ │ └── [email protected]
  │ │ │   │ └── [email protected]
  │ │ │   ├─┬ [email protected]
  │ │ │   │ ├── [email protected]
  │ │ │   │ └── [email protected]
  │ │ │   └─┬ [email protected]
  │ │ │     ├── [email protected]
  │ │ │     └── [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ ├── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └── [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └── [email protected]
  │ │ ├── [email protected]
  │ │ └─┬ [email protected]
  │ │   ├─┬ [email protected]
  │ │   │ └─┬ [email protected]
  │ │   │   ├── [email protected]
  │ │   │   └── [email protected]
  │ │   └─┬ [email protected]
  │ │     ├── [email protected]
  │ │     ├── [email protected]
  │ │     ├── [email protected]
  │ │     ├── [email protected]
  │ │     └── [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ ├─┬ [email protected]
  │ │ │ └── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ └── [email protected]
  ├── [email protected]
  └─┬ [email protected]
    └── [email protected]

$

hexo相關信息

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
$ type hexo
hexo is hashed (/usr/bin/hexo)
$ which hexo
/usr/bin/hexo

#hexo版本信息
$ hexo version
hexo-cli: 0.2.0
os: Linux 3.10.0-327.4.4.el7.x86_64 linux x64
http_parser: 2.6.0
node: 5.4.0
v8: 4.6.85.31
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 47
openssl: 1.0.2e
$

Setup Hexo

安裝目錄以/home/flying/ndoe_hexo爲例

Setup Blog Dir

執行命令

1
2
3
4
5
mkdir /home/flying/node_hexo
cd /home/flying/node_hexo
hexo init LempStacker.github.io
cd LempStacker.github.io
npm install

操作過程

  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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
[[email protected] node_hexo]$ hexo init LempStacker.github.io
INFO  Cloning hexo-starter to ~/node_hexo/LempStacker.github.io
Cloning into '/home/flying/node_hexo/LempStacker.github.io'...
remote: Counting objects: 40, done.
remote: Total 40 (delta 0), reused 0 (delta 0), pack-reused 40
Unpacking objects: 100% (40/40), done.
Checking connectivity... done.
Submodule 'themes/landscape' (https://github.com/hexojs/hexo-theme-landscape.git) registered for path 'themes/landscape'
Cloning into 'themes/landscape'...
remote: Counting objects: 818, done.
remote: Total 818 (delta 0), reused 0 (delta 0), pack-reused 818
Receiving objects: 100% (818/818), 2.54 MiB | 16.00 KiB/s, done.
Resolving deltas: 100% (430/430), done.
Checking connectivity... done.
Submodule path 'themes/landscape': checked out 'cec7746c852676d311246c789a0f0a0f28da4c9f'
INFO  Install dependencies
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install /home/flying/node_hexo/LempStacker.github.io/node_modules/dtrace-provider
> node scripts/install.js

[email protected] /home/flying/node_hexo/LempStacker.github.io
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └─┬ [email protected]
│ │ │     ├─┬ [email protected]
│ │ │     │ └── [email protected]
│ │ │     └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   ├── [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └─┬ [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   ├── [email protected]
│ │ │ │   │ │   └── [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   └─┬ [email protected]
│ │ │ │     ├── [email protected]
│ │ │ │     └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └─┬ [email protected]
│ │ │     ├── [email protected]
│ │ │     └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   ├── [email protected]
│ │   └─┬ [email protected]
│ │     ├── [email protected]
│ │     ├── [email protected]
│ │     ├── [email protected]
│ │     └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   └─┬ [email protected]
│     ├── [email protected]
│     └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├─┬ [email protected]
│ │   │ └── [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├─┬ [email protected]
│   │ └─┬ [email protected]
│   │   ├── [email protected]
│   │   └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └─┬ [email protected]
│     └── [email protected]
└─┬ [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected]
  │ ├── [email protected]
  │ └── [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ ├── [email protected]
  │ │ └── [email protected]
  │ └── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ ├── [email protected]
  │ ├── [email protected]
  │ └─┬ [email protected]
  │   └── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ └── [email protected]
  └─┬ [email protected]
    ├── [email protected]
    └─┬ [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      ├── [email protected]
      └── [email protected]

INFO  Start blogging with Hexo!

#切換到LempStacker.github.io/目錄下
[[email protected] node_hexo]$ cd LempStacker.github.io/

#列出目錄下內容
[[email protected] LempStacker.github.io]$ ls
_config.yml  node_modules  package.json  scaffolds  source  themes

#執行npm install
[[email protected] LempStacker.github.io]$ npm install
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN install Couldn't install optional dependency: Unsupported

#使用tree命令以樹狀形式列出目錄下文件
[[email protected] LempStacker.github.io]$ tree -L 1
.
├── _config.yml
├── node_modules
├── package.json
├── scaffolds
├── source
└── themes

4 directories, 2 files
[[email protected] LempStacker.github.io]$

File Explanation

file Explanation
_config.yml Site configuration file. You can configure most settings here.
db_json
package.json
node_modules
scaffolds Scaffold folder. When you create a new post, Hexo bases the new file on the scaffold.
themes Theme folder. Hexo generates a static website by combining the site contents with the theme.
source Source folder. This is where you put your site’s content.

Start the server

執行命令

1
hexo server

會提示INFO Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.

在瀏覽器中輸入URL http://0.0.0.0:4000/,可以查看本地博客頁面,按Ctrl+C停止。

操作過程

1
2
3
4
[[email protected] LempStacker.github.io]$ hexo server
INFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.
^CINFO  See you again
[[email protected] LempStacker.github.io]$

Configuration Hexo

配置文件_config.yml,相關參數說明見 Configuration。具體修改可參考 Hexo+github搭建个人博客 中相關操作。

本人目的是將域名lempstacker.com解析到LempStacker.github.io上,故在deploy中需要添加plugins: -hexo-generator-cname

配置詳情

 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
# Site
title: LempStacker
subtitle: Love you, my lover
description: 小馬的技術部落格,專注於GNU Linux,目標Full Stack
author: lempstacker
language: zh
timezone: Asia/Shanghai

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://lempstacker.com
root: /
permalink: :title/
permalink_defaults:

...
...

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: [email protected]:LempStacker/LempStacker.github.io.git
  branch: master
  plugins: -hexo-generator-cname

Bulid sitemap

爲SEO,建立網站地圖,方便搜索引擎抓取

安裝相關插件

1
2
3
4
npm install hexo-generator-sitemap --save

#本人沒有安裝此選項
npm install hexo-generator-baidu-sitemap --save

在配置文件_config.yml中添加

1
2
3
4
5
# auto create sitemap
sitemap:
path: sitemap.xml
#baidusitemap:
#path: baidusitemap.xml

提交後,在瀏覽器中輸入https://lempstacker.com/sitemap.xml即可查看生成的內容

Fetch Remote Git Repo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[[email protected] LempStacker.github.io]$ git init
Initialized empty Git repository in /home/flying/node_hexo/LempStacker.github.io/.git/
[[email protected] LempStacker.github.io]$ git remote add origin [email protected]:LempStacker/LempStacker.github.io.git
[[email protected] LempStacker.github.io]$ git fetch origin
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From github.com:LempStacker/LempStacker.github.io
 * [new branch]      master     -> origin/master
[[email protected] LempStacker.github.io]$ git merge origin/master
[[email protected] LempStacker.github.io]$

以下操作請不要使用sudo操作,會報錯

1
2
Permission denied (publickey).
fatal: Could not read from remote repository

GitHub官方說明 Error: Permission denied (publickey)

Deploy to GitHub

因有獨立域名lempstacker.com,故需要先執行如下命令

1
npm install hexo-generator-cname --save

操作過程

1
2
3
4
5
6
7
[[email protected] LempStacker.github.io]$ npm install hexo-generator-cname --save
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN install Couldn't install optional dependency: Unsupported
[email protected] /home/flying/node_hexo/LempStacker.github.io
└── [email protected]

[[email protected] LempStacker.github.io]$

執行如下命令

1
2
3
4
5
6
7
8
git add .
git commit -m "描述信息
git push origin master
hexo g
npm install hexo-deployer-git --save
hexo d
git fetch origin
git merge origin/master

在瀏覽器中輸入http://lempstacker.com/即能正常訪問剛生成的網站了。

hexo _config.yml

此爲_config.yml文件,備份用

 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
# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: LempStacker
#subtitle: Love you, my lover
subtitle: Master Technology, Change Destiny
description: The only thing I can control is myself
#description: 小馬的技術部落格,專注於GNU Linux,目標Full Stack
keywords: Linux,CentOS7,LEMP,MariaDB,Nginx,PHP,Python,Docker,Full Stack
author: lempstacker
language: en
timezone: Asia/Shanghai

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
#url: http://lempstacker.com
url: https://lempstacker.com   # with the https protocol
enforce_ssl: lempstacker.com   # without any protocol
root: /
permalink: :title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
#不渲染README.md,在source下生成README.md
skip_render: README.md

# Writing
#new_post_name: :title.md # File name of new posts
new_post_name: :year-:month-:day-:title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace:

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: http://hexo.io/plugins/
## Themes: http://hexo.io/themes/
#theme: landscape
theme: maupassant

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: [email protected]:LempStacker/LempStacker.github.io.git
  branch: master
  plugins: -hexo-generator-cname

hightlight:
  enable: true
  auto_detect: true
  line_number: true
  tab_replace:


# 自动生成sitemap
#npm install hexo-generator-sitemap --save
#npm install hexo-generator-baidu-sitemap --save
sitemap:
path: sitemap.xml
#baidusitemap:
#path: baidusitemap.xml

在主題的head中

1
2
3
meta(name='description', content=config.description)
meta(name='keywords', content=config.keywords)
meta(name='canonical' href='#{config.url}/#{page.path}')

Maupassant Edit

主題設置備份,項目路徑

https

在文件layout/_partial/head.jade中添加如下內容

1
2
3
4
5
script.
  var host = "lempstacker.com";
  if ((host == window.location.host) && (window.location.protocol != "https:")){
    window.location.protocol = "https";
  }

css

在文件source/css/style.css中line 1083 左右,將內容更改如下

1
2
3
4
5
6
7
// All lines in gutter and code container
.line {
    height:    1.3em;
    // font-size: 13px;
    //change code size
    font-size: 1em;
}

文件layout/_partial/footer.jade,將其中更換爲如下內容

1
2
3
4
5
6
7
8
#footer= 'Copyright © ' + date(Date.now(), 'YYYY') + ' '
  a(href=url_for('.'), rel='nofollow')= config.title + ' '
  | is licensed under <img style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/80x15.png" />.
  |  Powered by
  a(rel='nofollow', target='_blank', href='https://hexo.io')  Hexo.
  a(rel='nofollow', target='_blank', href='https://github.com/tufu9441/maupassant-hexo')  Theme
  |  by
  a(rel='nofollow', target='_blank', href='https://github.com/pagecho')  Cho.

文件layout/_widget/search.jade,對應更改placeholder中內容 * Google Search * Self Search

_config.yml

 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
fancybox: true ## If you want to use fancybox please set the value to true.
duoshuo: ## Your duoshuo_shortname, e.g. username
disqus: ## Your disqus_shortname, e.g. username
uyan: ## Your uyan_id. e.g. 1234567
gentie: ## Your gentie_productKey, e.g. fc799538c7ad4cf5a5a0c2877a90cbd7
google_search: true ## Use Google search, true/false.
baidu_search: ## Use Baidu search, true/false.
swiftype: ## Your swiftype_key, e.g. m7b11ZrsT8Me7gzApciT
tinysou: ## Your tinysou_key, e.g. 4ac092ad8d749fdc6293
self_search: true ## Use a jQuery-based local search engine, true/false.
google_analytics:  ## Your Google Analytics tracking id, e.g. UA-42425684-2
baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000
show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true.
toc_number: true ## If you want to add list number to toc please set the value to true.
shareto: true ## If you want to use the share button please set the value to true.
busuanzi: true ## If you want to use Busuanzi page views please set the value to true.
widgets_on_small_screens: false ## Set to true to enable widgets on small screens.

menu:
  - page: home
    directory: .
    icon: fa-home
  # - page: reading
  #   directory: reading/
  #   icon: fa-book
  - page: learning
    directory: learning/
    icon: fa-graduation-cap
#  - page: archive
#    directory: archives/
#    icon: fa-archive
  - page: about
    directory: about/
    icon: fa-user
  # - page: rss
  #   directory: atom.xml
  #   icon: fa-rss


widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links.
  - search
  - category
  - tag
  - recent_posts
  # - recent_comments
  - links

links:
  - title: Linux.com
    url: https://www.linux.com/
  - title: Opensource.com
    url: https://opensource.com/


# timeline:
#   - num: 1
#     word: 2014/06/12-Start
#   - num: 2
#     word: 2014/11/29-XXX
#   - num: 3
#     word: 2015/02/18-DDD
#   - num: 4
#     word: More

# Static files
js: js
css: css

# Theme version
version: 0.0.0

References

Change Log

  • 2016.01.21 18:50 Thu Asia/Beijing
    • 初稿完成
  • 2016.01.26 19:22 Tue Asia/Beijing
    • 更新sitemap,添加README.md
  • 2016.07.08 15:21 Fri Asia/Shanghai
    • 添加Maupassant Edit、更改_config.yml
  • 2017.01.31 12:07 Tue America/Boston
    • 主題更新,配置修改
  • 2017.05.04 09:21 Thu America/Boston
    • 主題更新,配置修改
  • 2019.04.28 14:33 Sun America/Boston
    • 勘誤,遷移到新Blog