分享

Octopress: a blogging framework for hackers

 思考的轨迹 2012-02-16

Octopress: a blogging framework for hackers

Installing

先安裝 rvm

bash < <(curl -s https://rvm./install/rvm)

將 rvm 指令變成 shell function

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile

安裝 Ruby 1.9.2, RubyGems

rvm install 1.9.2 && rvm use 1.9.2
rvm rubygems latest

確認版本

ruby --version

下載 octopress 專案

git clone git://github.com/imathis/octopress.git octopress
cd octopress

安裝 bundler

gem install bundler
bundle install

安裝預設佈景

rake install

發佈到 GitHub (免費)

先建立 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 generate
rake 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

日後有 Octopress 新版本發佈,使用以下指令升級。

git pull octopress master     # Get the latest Octopress
bundle install                # Keep gems updated
rake update_source            # update the template's source
rake update_style             # update the template's style

常用指令

建立新文章

rake new_post["how-to-install-octopress"] 

常用語法

程式碼區塊

``` groovy
println 1+2+3
```

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多