Clone 已有 Octopress blog

Octopress 的後端就是自己的電腦,有多台電腦時需要在其他電腦再建立 Octopress 的撰寫環境,並且拿 Github 上面的 repos 下來繼續寫。

安裝環境

基本環境:Git for WindowsRubyInstaller 1.9.3Ruby Development kit。如果用到 code highlight,要裝 Python 2,否則 rake generate 會生出空白頁。安裝完 Ruby 跟 Python 要在環境變數 PATH 加入 Ruby 的 bin 資料夾路徑以及 Python 的安裝路徑,如 C:\Ruby193\binC:\Python27

Clone repository

1
2
3
4
$ git clone -b source https://github.com/[username]/[username].github.io octopress

$ cd octopress
$ git clone https://github.com/[username]/[username].github.io _deploy

Octopress 將 master branch 放在 _deploy/

Rake installation and configuration

1
2
3
$ gem install bundler
$ bundle install
$ rake setup_github_pages

最後一個指令會要求輸入 Github 的 repository URL。

Pull repository

有多台電腦編輯時,開始前要記得將 local repository 更新到最新。

1
2
3
$ git pull origin source
$ cd _deploy
$ git pull origin master

Ref