在Github上使用octopress建構blog
1. on mac
1
2
3
| $ cd ~/.ssh
$ ssh-keygen -t rsa -C "xxx@xxx.xxx.xx"
$ pbcopy < ~/.ssh/id_rsa.pub #copy pubkey to clipboard
|
2. on Github
github 申請帳號 (e.g. xxxx)
github 建立 xxxx.github.io 的repository
github 上傳ssh key
3. back to mac
1
| $ ssh -T git@github.com #for testing your sshkey
|
4. Local端 安裝octopress
1
2
3
4
5
| $ git clone git://github.com/imathis/octopress.git octopress
$ cd octopress
$ bundle install
$ rake install
$ rake setup_github_pages
|
trouble shooting
- problem during “rake deploy”
在 rake deploy 會出現 error, 解決方法如下
- 編輯 Rakefile (Edit the Rakefile and look for this line:)
1
| system "git push origin #{deploy_branch}"
|
修改成
1
| system "git push origin +#{deploy_branch}"
|
1
2
3
4
| cd octopress/_deploy
git pull origin master
cd ..
rake deploy
|
1
2
3
| $ git add .
$ git commit -m 'xxxxx'
$ git push origin source
|
If you use zsh, you would better add the following line in .zshrc for preventing you from error of “rake new_post[“xxxx”]“.
1
| alias rake="noglob rake"
|