1 | mkdir hexo #创建一个文件夹 |
部署Hexo:在Git shell 中输入1
hexo init
安装Hexo 插件:自动生成sitemap,Rss,部署到git等,建议安装1
2
3
4
5
6
7
8
9
10
11
12
13npm install hexo-generator-index --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save
npm install hexo-server --save
npm install hexo-deployer-git --save
npm install hexo-deployer-heroku --save
npm install hexo-deployer-rsync --save
npm install hexo-deployer-openshift --save
npm install hexo-renderer-marked@0.2 --save
npm install hexo-renderer-stylus@0.2 --save
npm install hexo-generator-feed@1 --save
npm install hexo-generator-sitemap@1 --save
Git获取SSHKey
- 打开 Git Bash.
- Paste the text below, substituting in your GitHub email address.
1
2
3ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
or
ssh-keygen -t rsa -C "your_email@youremail.com"
3.回车3次
4.在Git Bash 输入1
2ssh -T git@github.com
ssh -T git@git.coding.net
测试是否生效
5.如下提示说明成功1
2Hi username!
You've successfully authenticated, but GitHub does not provide shell access.
Git-backup
Install
if version is 3.x.x, you should install as follow:
1 | $ npm install hexo-git-backup --save |
Update
if you install with –save, you must remove firstly when you update it.
1 | $ npm remove hexo-git-backup |
Configure
You should configure this plugin in _config.yml
.
1 | backup: |
Using
1 | hexo backup |
or1
hexo b
Options
if you want to back up with your theme,just add theme: your theme name,your theme name
in _config.yml
.
1 | backup: |
Attention: if you do as above, the dir themes/coney/.git
will be removed
if you want DIY commit message, just add ‘message: update xxx’.1
2
3
4
5
6backup:
type: git
message: update xxx
repository:
github: git@github.com:xxx/xxx.git,branchName
gitcafe: git@github.com:xxx/xxx.git,branchName
Now you can backup all the blog!
Problems
You may get some troubles by your computer’ permission。
###Error: EISDIR, open
it is caused by permission.
just do ‘sudo hexo b’1
sudo hexo b