本文介绍hexo如何与github结合打造个人博客,其中涉及github、hexo的相关配置。分享给大家共同学习、交流。
演示地址
hexo相关配置
修改配置文件中deploy
1 2 3 4
| deploy: type: github repository: git@github.com:your-github/your-github.github.io.git branch: master
|
1 2 3 4
| deploy: type: git repository: git@github.com:your-github/your-github.github.io.git branch: master
|
安装 hexo-deployer
1
| $ npm install hexo-deployer-git --save
|
Github相关设置
1 2 3
| git config --global user.name "your-github" git config --global user.email "your-github@xx.com" ssh-keygen -t rsa -C "xxx@xx.com"
|
找到c盘.ssh文件夹下的id_rsa.pub,将文件内容拷贝到github中的setting的ssh下面
同步文件到github
1 2 3 4
| $ hexo generate $ hexo deploy // or $ hexo deploy -m '提交信息'
|