先安裝 rvm
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
將 rvm 指令變成 shell function
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profilesource ~/.bash_profile
安裝 Ruby 1.9.2, RubyGems
rvm install 1.9.2 && rvm use 1.9.2rvm rubygems latest
確認版本
ruby --version
下載 octopress 專案
git clone git://github.com/imathis/octopress.git octopresscd octopress
安裝 bundler
gem install bundlerbundle install
安裝預設佈景
rake install
先建立 GitHub Repository ,並使用 username.github.com 命名(如果是組織則用 organization.github.com),例如你的 GitHub 帳號是 john2011 就將 Repository 命名為 john2011.github.com,完成後會得到一組 GitHub Pages URL http://yourname.github.com/ (注意不能用 https: 必須用 http: )。
設定 GitHub Pages
rake setup_github_pages
以上執行後會要求 read/write url for repository :
git@github.com:yourname/yourname.github.com.git
建立及發佈
rake generaterake deploy
等待幾分鐘時間,會收到一封信:「[sslab.github.com] Page build successful」,第一次發佈會等比較久,之後每次都會直接更新。
瀏覽 http://yourname.github.com/
將 source 也加入 git
git add .git commit -m 'initial source commit'git push origin source
日後有 Octopress 新版本發佈,使用以下指令升級。
git pull octopress master # Get the latest Octopressbundle install # Keep gems updatedrake update_source # update the template's sourcerake update_style # update the template's style
建立新文章
rake new_post["how-to-install-octopress"]
程式碼區塊
``` groovyprintln 1+2+3```
联系客服