使用 hexo + github 部署博客
安装部署 hexo
参考这个知乎文章安装
1. 准备 node、git
2. 安装 hexo-cli
1
$ npm i -g hexo-cli
3. 创建一个网站
1
$ hexo init xxx.github.io
4. 部署服务器
这里选择部署到 git 上。
1. 首先安装 git deployer
2. 然后修改配置文件,选择部署方式为 git 并配置 repo。
3. hexo 部署
4. 访问 xxx.github.io 即可
1
2
3
4
5
6
7
8
9
10
$ npm install hexo-deployer-git --save
$ vi _config.yml
deploy:
type: git
repo:
branch: [branch]
message: [message]
$ npm d
注意:
1. 可以选择同时部署到多个服务器。多写几个 ‘deploy’ 配置即可
2. git 用户名、网站用户名(xxx.github.io 中的 xxx)必须相同。因为它相当于使用 github 服务器
设置 theme
在 官方 themes 里挑。我比较喜欢以下几款:
1. 带目录结构的: 2. cactus:英文的,有几种颜色可以选,带目录,可以