Setup Octopress Under Mac OS X Lion
It’s the first post I wrote under octopress. So it’s good to share my experience to install and setup on my iMac. Mostly I refered to this great post and the official document of octopress and github.
First, please open terminal and install homebrew by
$ /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
I already have xcode installed, so I didn’t need to mannually install GCC, If you don’t have it yet, you could download it from Mac App Store, it’s free.
Then edit ~/.bash_login add this line:
Update homebrew package information:
$ brew update
Then install necessary packages via homebrew:
$ brew install ruby ruby-build rbenv pow
Even though Mac already include Ruby, but the version is too low ( 1.8.7 ), octopress require at least 1.9.2. Then we need to add the Ruby into our PATH, so edit ~/.bash_login add this line:
Please modify the version according to your installation.
Then we could install octopress now, change to directory ~/Sites,
$ git clone git://github.com/imathis/octopress.git octopress $ cd octopress
Install some ruby stuffs octopress required:
$ gem install bundler $ rbenv rehash $ bundle install $ rake install
Then octopress is installed.
Login into github then add a repository username.github.com. Please use your username instead. For me, as your url address showed, it’s easonx.github.com. For this kind of special repository name, you cannot add github page in the admin interface, install, it will be your default content for the site.
Once this is done, in Terminal:
$ rake setup_github_pages
The system will ask your git URL. it should be like this,
also, replace username to your own id.
$ rake generate
$ rake deploy
If this is the first time you upload the site, it may wait 10 minutes to initialized the site. But afterwards you can see change immediately. The system will email you to annouce the availability.
Customization and Post
You could modified the config file: _config.yml to do some simple customization.
To add post:
$ rake new_post["Your long post name"]
Please refer to the official document for further references.
Follow the instruction of this entry.
- copy qrcode.html into source/_includes/custom/asides/
- add ‘custom/asides/qrcode.html’ to default_asides in _config.yml