Wivern Blog

Personal-Tech memorandum

OctopressをGitHubのProject Pageで作成

Project Page (gh-pages) にデプロイする場合

Github Pagesでサイトを公開する場合は[username].github.ioというリポジトリを作成し、 デプロイすることでhttps://[username].github.ioでアクセスすることができるが、任意のリポジトリを作成し、 Project Page(gh-pages)にデプロイすることもできる。

ユーザのウェブページを公開するユーザサイト(User site)[username].github.io でアクセスとの違いは、 URlがhttps://[username].github.io/[repository_name/]になることと [username].github.io リポジトリのときとは異なり、_deploy/ ディレクトリは gh-pages ブランチに設定される。

Octopressのインストールは以前書いたとおりgit cloneするだけ。
あとは必要なgembundle --path vendor/bundebundel exec rake installでインストール。

事前にGithubでリポジトリを作成しておく。

1
2
$ rake setup_github_pages
Repository url: git@github.com:[username]/[username].github.io.git

上記によって、以下のことが行われる。

  • git@github.com:[username]/[username].github.io.gitorigin remote として追加される
  • _deploy/ ディレクトリがリポジトリの gh-pages ブランチに設定される
  • 親ディレクトリは source ブランチになる

ソースコードを管理するため、remote のリポジトリURLを設定

1
2
$ git remote add origin git@github.com:[username]/[repository_name].git 
$ git config branch.master.remote origin