Blogging was really never easy task for me, I started in 2006 with WordPress but with short life. The more about my blogging history can be read in my blog post and finally comes time for Blogging! on my old blogging site Learn-a-holic.
So far I was on this blog engines, chronologically:
So far I was always coming back to WordPress, but I was never actually satisfied in writing posts in it, everything other than that is plain perfect on WordPress. This is why I haven’t blogging for nearly two years.
Nowdays I really like markdown or any similar kind of markup language (textile, creole,…), and I would prefer writing blog posts with markdown. In my case blog posts are more notes than the blog posts, because they are more technical, and there is lots of code snippets!
You’ll need to change the clone to your repository, since there is need for Read+Write access!
I’m lying a bit the first attempt was a clone, but afterwards I’ve chose to fork it, why?, you’ll need to read about it a little bit later.
Using Octopress with Rake
The Octopress needs for the first time to generate the sandbox with theme and placeholder folder for posts. It can be achieved by running (needs to be in forked/cloned directory):
1 2 3 4 5 6 7 8
The command will create
sass folders. The
source/_posts folder is where the markdown
posts will reside.
This is why I forked the Octopress, so that I can commit the posts as the markdown files, if I would clone it, I should have the write access to Octopress, to commit, this way I have my forked version and still I can always pull changes from upsteramed original Octopress, but more of this in separate post.
Creating first post
Create post with
new_post['post name here']:
1 2 3
By opening it in your favorite editor you’ll get:
1 2 3 4 5 6 7
Categories can be add in few ways, my way is one-liner:
categories: [octopress, github, github pages]
Generating the Site
Add some content to your first post and then run
generate command that generates whole site:
1 2 3 4 5 6 7
To locally preview generated Site use:
1 2 3 4 5 6 7 8
Then in browser navigate to:
The beauty of the
preview is that Auto-regenerating is enabled by default.
Meaning every save of blog post file will trigger
generate command making it as live preview.
Configuring the Octopress
The Octopress configuration is in the root
There you can change
and set site comments via disqus by providing
Github Pages setup
There are two ways of having pages on the Github.
The User/Organization pages
http://username.github.com and project pages
The my way was the User/Organization pages.
Setting up the repository on Github
Create new repository on Github and named it as your User/Organization name plus
in my case was
Configure Octopress for Github Pages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
This command will change
git remote origin from Octopress forked/cloned url to:
And also add a
_deploy folder, actual root of your Github Pages repository
Deployment to Github Pages
rake command is
deploy. It will create commit and push to Github
repo and you’ll get notification to your mail.
1 2 3 4 5 6 7 8 9 10
After deployment in your mail box will be a notification:
[xajler.github.com] Page build successful Your page has been built. If this is the first time you've pushed, it may take a few minutes to appear, otherwise your changes should appear immediately.
And if you navigate to
http://xajler.github.com (change xajler to your User/Organization name)
you’ll see the post and site online!
The custom domain via CNAME
http://xajler.github.com is not really the URL that you’ll want to have for the blog.
Github provides the way to customize the domain name.
Setting custom domain name
To setup the custom domain name that will point to your Github pages, there is need to
CNAME file in
source folder. This
CNAME will be copied to
rake deploy and will be used by Github to point to the provided domain.
I’ve added my subdomain for my domain metaintellect.
rake deploy and it should now be pushed and visible in your
Github repo (
Setting DNS for subdomain
Here is my configuration to make the
blog.metaintellect.com CNAME work with Github Pages:
I hope that I will now blog my notes about so many tehnical IT stuff I do everyday, and now with markdown and the Github it is fairly easy and fun!