Please enable JavaScript to view the math powered by MathJax

I've been wondering about self-hosting a blog. Blog engines with SQL databases feel like a black box concept and put me off. I'd like to have my posts as a bunch of readable text files and some way to generate a static blog from them. And version control on all this would be quite useful. I've had this in my mind for a while, when I recently came across Ruhoh.

Ruhoh is a program that essentially swallows a bunch of text (markdown) files and spits out a static blog. Since the default deployment choice is through Github, git is the version control tool of choice. All together, ruhoh seemed to me to be exciting and simple enough for me to dive into. Installing ruhoh and creating this blog was a piece of cake. To my understanding, the files are hosted in a Github repository of mine, and displayed through a ruhoh.com web address. I've been playing around with ruhoh for a few days now. I'm happy with it and a few posts might pop up here over the following weeks.

Once installed, ruhoh is a breeze to use. I decided to write a small usage summary for myself. Some might find it interesting enough to try.

How to install Ruhoh

I assume you have the ruby setup (I might update that bit if you need help). To install ruhoh, just type gem install ruhoh on the command line, and follow your nose.

Then, you need to download the blog template, aka scaffolding check http://ruhoh.com. As of the time of editing this article, ruhoh is undergoing some changes. I will update this post once I've wrapped my head around the changes.

How to use Ruhoh

In the root folder of the blog, ruhoh draft "draft-title" will create a new draft with the desired title inside the posts folder. I can then edit the file in any text editor of my choice. The "type: draft" in the file header tells Ruhoh that this post is still a draft. To publish, I'll have to modify the file to leave that field empty.

After I'm done, I'll be using rackup -p 9292 to check a local deployment of my blog. The default view is a preview mode that shows all drafts as blog posts. To view the blog in the "production" mode (where only published posts are displayed), uncomment the requisite line in config.ru in ruhoh root directory. When done making changes, I can commit them using git. I can then sync the blog by pushing my local repository to my Github repo for this blog.

If I wanted to host this on any other web server, I can generate a static blog with the command ruhoh compile. This will generate a static website inside the "compiled" folder, which can then be copied on to a webserver.

Ruhoh has a few plugins already and there is a nice one for having comments on the blog. I decided to go with Disqus. Registering with Disqus and enabling comments on the blog (small edits to widgets/comments/config.yml) was also pretty easy.

All those blogging options that I mentioned seem like interesting choices for geeks looking to get their hands dirty and self host. Ruhoh promises to be an open box where you can look at and understand how a blog generator works. With its modular nature, it should be easy to tweak some parts to suit custom needs.

Ruby based static blog generators seem to have a rich ecosystem. Jekyll and other tools based on it (jekyll-bootstrap, octopress) are very popular. To me ruhoh seemed a tad easier to use. If this post inspires you to try one of 'em out for yourself, do let me know how it goes.

For more about ruhoh, check http://ruhoh.com



blog comments powered by Disqus

Published

2012-07-05

Tags