I am using Mac OS X 10.8, Ubuntu 12.10 and Windows Vista at present. I want to have a simple blog which can be coutrolled by myself …
Install Ruby 1.9.3
Octopress depends on Ruby 1.9.2 or newer.
Mac X 10.8
The Ruby provided by mac is 1.8.7, so we need to install the latest one by ourself.
The missing package manager for OS X - Homebrew, provides ruby 1.9.3.
1 2 3 |
|
Edit ~/.bash_login and add following line:
1 |
|
Ubuntu 12.10
Nothing special, apt-get is enough.
Windows
Download RubyInstaller and DevKit, then install them.
"Start Command Prompt with Ruby", and changed to the directory where DevKit extracted, and run:
1 2 3 |
|
Set environment variable
1 2 |
|
Install octopress
Download the octopress
1 2 |
|
Install some stuff.
1 2 3 |
|
Configure octopress
- Open _config.yml, then edit
url
, title
, subtitle
, and author
- Open source/_include/custom/head.html,
then comment
1 2 |
|
As they has been blocked in China, which make the blog take too long time to load.
Write and View Blog
To add a new post
1 |
|
Then
1 2 |
|
Deploy
Create a repository called username.github.com
Run
1 |
|
Produce HTML and Deploy it.
1 2 |
|
Push source to the source branch, or other private place.
1 2 3 |
|
Custom Domain
I want to use blog.debao.me
for my pages. So create a file called CNAME
under source
directory. Then put the subdomain into the file
1 |
|
Next, I need to setup my DNS. Add a CNAME record pointing to the pages is enough.
1 |
|
Redirect?
At present, I hope that following two domains can be redirected to the pages too.
1 2 |
|
This is very easy, isn't it?
Though many Sponsoring Registrars such as godaddy
have provided such function for us. But it doesn't work in China.
So I need to create another site, then let such too domains point to it.
Project pages provided by github can be used in such cases. What we need is a index.html file, such as
1 2 3 4 5 6 7 8 9 10 |
|
Then, create a CNAME file
1 |
|
Push above files to gh-pages branch.
Next, I need to setup my DNS. Add two A records pointing to the pages.
1 2 |
|
Note that, github will automaticly generate redirect from www.xxxx.me to xxxx.me for us.
Remove blog from url path
The urls of my blog look like this
1 |
|
which seems not good. So I want to move evertything to the root directory.
First, _config.yml
file:
1 2 3 |
|
Second, source/_include/custon/navigation.html
1 |
|
And source/index.html
1 |
|
Finally, Move archives
from directory source/blog
to source
.