Toto es Todo: Blogging Made Real Easy
ShareThis
February 22nd 2010
Please excuse my spanish, I used to be fluent in French so I approximated. I thought it fitting that I blog about toto and Heroku the really awesome software powering The Modest Rubyist. In this post I will talk a bit about how I setup The Modest Rubyist using these two tools but mostly about why they are so awesome.
Toto is blogging using tools you as a rubyist are probably intimately familiar with: your text editor and, hopefully, git. Each article is simply a .txt file. Mix in some YAML at the top of the file for metadata and Markdown in the body for flavor and a toto post you have.
The quickest, and suggested way to get up and running with toto is to clone Dorthy. This repository is a skeleton blog running toto. Toto is built on top of Rack so Dorthy provides a simple config.ru file with enough code comments to easily understand what is going on. ERB is used for templating so if your familiar with the basics of Rails views you will be able to tweak the look & feel of your blog. Dorthy comes with a basic template which I found to be a great starting point. Dorthy’s template uses HTML5’s article & section tags which is a plus, in my opinion.
Once you have Dorthy on your machine you can view it as is by starting it up using one of several Ruby web servers. I chose Thin. To boot up your blog locally with Thin type the following at the command line:
Thin start -R config.ru
You can install Thin with:
gem install thin
You will need g++ installed. I had no problems on my laptop running Ubuntu 9.10.
Blogging is pretty useless however if only you can see it on your local machine. Toto was designed with cloud hosting like Heroku in mind. Instead of rewriting the instructions I used to get up and running on Heroku you can read this great write up on Rails Inside.
Once your setup on Heroku, its time to write your first article. Add a new .txt file in the articles directory of your blog root directory following the naming convention of the file provided with Dorthy. Use that same file as a template for your article. There should be 3 simple YAML fields at the top of your file (title, author, date), followed by a blank line, and then the body of your post. Remove the example article, commit your changes and push up to Heroku. Your new post is live to the world.
Now that you’ve seen the ease of Toto I’d like to direct your attention to some other advantages you may or may not have noticed. One reason I really like toto is how easy it is to backup not only your content but your entire layout, as well. If you create a new GitHub repository for example you can remove the origin remote pointing to Dorthy and point a new remote at your repository. To back up everything just do a push to it. Want to experiment with a new design idea that you came up with? Branch out in your local repository, work on your changes and simply merge ‘em in when your ready. Back up as often as you please; make the changes public by doing another push to Heroku. Another advantage I have heard tossed around is, “Go ahead, try to hack my toto admin panel! You will be looking for it forever, it exists on my hard drive, muahhaha!”
As you can see toto is one awesome piece of Ruby goodness. It may not be software we can sell our clients but its a great way for the rubyist with a want to express him/herself, blog style, easily. One last resource I’d like to leave you with is these screencasts by Oren at Heroku. This helpful walkthrough shows how to setup a domain purchased from GoDaddy to point to your blog. You will need to provide Heroku with some billing information but it is for fraud prevention purposes only, you will not be charged (I am personally vouching for this as I went through this process last night). The screencasts show how to both setup your blog with or without email. I chose to not have email for this domain for now. If you do plan to use email you should watch both videos in order. Also, don’t be alarmed if GoDaddy takes some time to propogate your DNS changes. Unlike the screencasts, the newest update to GoDaddy’s Total DNS Panel removed the status listings. You will need to wait a little longer than Oren makes it seem to run commands such as host <your domain> to complete the setup process.