Octopress + github でブログを始める

- - posted in Octopress, github

OCTOPRESS

Octopress

http://octopress.org/

github

https://github.com/

githubでリポジトリを作成

リポジトリ名がURLになる。

http://{ユーザー名}.github.com/{リポジトリ名}/

Octopressインストール

  • 2012/07/08 時点ではRuby 1.9.2でしか動作しないようなので rbenv等で環境を用意する。

  • Octopress用のディレクトリで使うRubyのバージョンを固定する

$ rubyenv local 1.9.2-p320 → .rbenv-version ファイルが作られて、その中に選択したバージョンが書き込まれる

Octopress Setup

http://octopress.org/docs/setup/

Octpressの設定

_config.yml を編集する

Github Pagesにデプロイ

Deploying to Github Pages

http://octopress.org/docs/deploying/github/

  • 投稿作成

$ rake new_post[“投稿タイトル”]

source/_posts/YYYY-MM-DD-{投稿タイトル}.markdown を編集

  • HTML生成

$ rake generate

  • プレビュー(localhost:4000)

$ rake preview

編集内容は即時反映される

  • ブログにアップ

$ rake deploy

Comments