本文介绍hexo如何与github结合打造个人博客,其中涉及github、hexo的相关配置。分享给大家共同学习、交流。
hexo相关配置
修改配置文件中deploy
版本3.0一下
1
2
3
4deploy:
type: github
repository: git@github.com:your-github/your-github.github.io.git
branch: master版本3.0以及之上
1 | deploy: |
安装 hexo-deployer
1 | $ npm install hexo-deployer-git --save |
Github相关设置
注册github账号(自行百度搜索)
设置ssh
1
2
3git config --global user.name "your-github"
git config --global user.email "your-github@xx.com"
ssh-keygen -t rsa -C "xxx@xx.com"github上配置秘钥
找到c盘.ssh文件夹下的id_rsa.pub,将文件内容拷贝到github中的setting的ssh下面
同步文件到github
- 生成静态文件并发布
1 | $ hexo generate |