
This blog is mainly about how to post a blog on Github with Octopress, and the setup of a Markdown-style document editor - Sublime Text is also introduced.
1. Octopress
What is Octopress
Octopress is a blogging tool build with Ruby, and can be downloaded from Github.
How to build the Octopress
Here is the building process on Ubuntu, and it seems similar on other OS.
Install Git
1
|
|
Install Ruby
1
|
|
Download Octopress
Clone the octopress to local directory octopress:
1
|
|
Install the dependencies
Enter the directory of octopress:
1
|
|
And type in following command:
1 2 3 |
|
Install default theme of Octopress
1
|
|
Initiate blog pages and commit source
Before posting a new blog to Github, a respository with the name yourname.github.io is expected to bulid.
Then run the setup:
1
|
|
Follow the instructions and type in the answers of what they ask.
Finally, generate and deploy your blog site onto Github:
1 2 |
|
The source for your blog should also be committed:
1 2 3 |
|
Posting a new blog
Use command rake new_post[] to create a new blog file in source/_post:
1
|
|
Everytime before posting a new blog, command:
1 2 |
|
should be run to generate the formatted blog and deploy it to Github.
2. Local Markdown editor - Sublime Text
After the Octopress is build, what we need now is a powerful editor helping to write a markdown-style document gracefully. And Sublime Text is just one perfect choice.
Installation
Sublime Text is a cross platform and sophisticated text editor for code, markup and prose. Once being installed and it can be evaluated for free. However, such a powerful editor does not directly enable markdown-style editing. Therefore, it is necessary to add markdown packages into Sublime Text.
Steps:
- Use
Ctrl+`to call the console. - Copy following code into the command line of console:
1
|
|
- Press key
Enterto run the code above and then restart Sublime Text 2. - Use
Ctrl+Shift+Pto call the Command Palette. - Type in
PCIPand press keyEnter. - Type in key words to find package Markdown Preview and package Markdown Editing.
- Click and install these two packages.
-
Done!
Congratulations! Let us undertake to write blogs on Github!




近期评论