Ubuntu 14.04 安裝Octopree
更新記錄
item | note |
---|---|
20150615 | 第一版 |
目錄
- 安裝其它必要軟体
- 參考Octopress Setup
- 其它相關說明
- 先使用preview預覽網頁內容
- 注意:記得將source 更新 & deploy
- 已存在github網頁,如何checkout到octopress
- 參考來源
安裝其它必要軟体
1 | sudo apt-get install ruby1.9.1-dev |
參考Octopress Setup
1 | git clone git://github.com/imathis/octopress.git octopress |
設定github blog
- 先到github申請,設定庫名稱(username.github.io)
- 輸入 git@github.com:username/username.github.io.git
1 | rake setup_github_pages |
其它相關說明
- octopress 由git clone產生
- octopress/source此為使用者個人的網頁修改記錄(記錄在source branch)
- octopress/_depoly為使用者個人的github(記錄在master branch)
- 若有git使用上問題,可以直接到octopress/_depoly目錄,直接執行git指令
先使用preview預覽網頁內容
- 產生新的頁面
1
rake 'new_post["title"]'
- rake generate ,參考source內容產生_deploy目錄內容
- rake preview ,預覽產生內容
注意:記得將source 更新 & deploy
1 | git add . |
- rake deploy ,更新發布網頁內容(也可以直接到_depoly目錄內使用git指令)
已存在github網頁,如何checkout到octopress
- 下載已存在github blog及切換到source branch
1 | git clone git@github.com:erwinchang/erwinchang.github.io.git blog |
- 目前git目錄訊息如下
1 | (source-bdcf6ca)1h41m erwin@erwin-minipc:/opt/data2/data/github/erwinchang.github.io$ cat .git/config |
- 安裝rake相關工具 及執行gen_deploy(此時會有錯誤)
1 | gem install bundler |
- 產生deploy目錄及更新到最新
1 | mkdir _deploy |
- 操作訊息如下
1 | (master-) erwin@erwin-minipc:/opt/data2/data/github/erwinchang.github.io/_deploy$ git init |
- 更新branch source到最新的及產生新的網頁內容(public)且更新到git server(由_depoly目錄產生)
1 | git pull origin source |
- 操作訊息如下
1 | (source-bdcf6ca)2h16m erwin@erwin-minipc:/opt/data2/data/github/erwinchang.github.io$ git pull origin source |
- 之後就可以正常rake geanerate/rake preive/rake deploy