eji著

主にプログラミングや山登りの話などを書いていく予定

Jekyll BootstrapとHerokuを使ってみた

コードは下のような感じで管理している。

f:id:eji:20121230034621p:plain
1. [plusjade/jekyll-bootstrap · GitHubからfork
2. Herokuで動かすためにGemfileとProcfileを用意してコミットする

$ git clone https://github.com/アカウント/jekyll-bootstrap.git
$ vim Gemfile Procfile _config.yml
$ git add . && git commit -am "add Gemfile and Procfile"
$ git push origin master

http://stachl.me/blog/2012/05/26/jekyll-on-heroku.html>titleを参考
3. forkしたリポジトリをブログ用のディレクトリにクローン

$ git clone https://github.com/アカウント/jekyll-bootstrap.git blog1

4. Bitbucket にブログ用プライベートリポジトリを作成してoriginを変更

$ cd blog1
$ git remote set-url origin ssh://git@bitbucket.org/アカウント/blog1.git
$ git remote -v      
origin  ssh://git@bitbucket.org/アカウント/diary.git (fetch)
origin  ssh://git@bitbucket.org/アカウント/diary.git (push)
$

5. クローン元をfork_masterとして登録

$ git remote add fork_master https://github.com/アカウント/jekyll-bootstrap.git
$ git remote -v 
fork_master     https://github.com/アカウント/jekyll-bootstrap.git (fetch)
fork_master     https://github.com/アカウント/jekyll-bootstrap.git (push)     
origin  ssh://git@bitbucket.org/アカウント/diary.git (fetch)
origin  ssh://git@bitbucket.org/アカウント/diary.git (push)
$

6. Herokuにブログ用のサイトを作ってpush

$ heroku login
$ heroku create --stack cedar blog1
$ git remote -v
fork_master     https://github.com/アカウント/jekyll-bootstrap.git (fetch)
fork_master     https://github.com/アカウント/jekyll-bootstrap.git (push)     
heroku  git@heroku.com:blog1.git (fetch)
heroku  git@heroku.com:blog1.git (push)
origin  ssh://git@bitbucket.org/アカウント/diary.git (fetch)
origin  ssh://git@bitbucket.org/アカウント/diary.git (push)
$ git push heroku master
$ heroku open

これでブログが1個Herokuに立ち上がる。もう1個ブログを増やしたい場合は3〜6を実行する。

Jekyll Bootstrap への変更はgithubでforkしたリポジトリで行って、自分のブログ用のリポジトリに以下のようにマージ。

$ cd blog1
$ git fetch fork_master
$ git merge remotes/fork_master/master

ブログの下書きはBitbucketにpushして公開したいときにHerokuにpushすれば良いって感じで運用している。今んとこ上手く行っている
gitの使い方は githubでfork元から最新を取り込む #git #Github - Qiita を参考にした。



数日前、パソコンにあまり詳しくない個人事業主向けにWordPressを導入してブログを運用するというセミナーのお手伝いをしたが、やっぱデータベースのところではまっていた。

Jekyllはデータベース使わないから、もう少しインタフェース改良したらパソコンに詳しくない人も使えるかなと思った。