安装Git
1 | git --version |
安装nodejs
1 | node -v |
安装Hexo
1 | npm install hexo -g |
1 | hexo -v |
配置ssh key
- 生成ssh key
1 | ssh-keygen -t rsa -C "邮件地址" |
- 将id_rsa.pub中的内容全部拷贝到Github个人页中的NewSSHKey中
1 | ssh -T git@github.com |
新建Github仓库
- 仓库名为“Github用户名.github.io”
初始化Blog目录
- 在Blog目录输入以下指令
1 | hexo init |
安装Hexo依赖
1 | npm install --save hexo-deployer-git |
配置_config.yml
- 修改博客目录下的_config.yml文件
1 | deploy: |
附
- 新建博客:hexo n
- 生成博客:hexo g
- 部署博客:hexo d
- 预览博客:hexo s
- 去掉Git提交时的换行警告
1 | git config --global core.autocrlf false |