blog in 10 seconds

philosophy

Everything that can be done better with another tool should be, but one should not have too much pie to stay fit.
In other words, toto does away with web frameworks or DSLs such as sinatra, and is built right on top of rack.
There is no database or ORM either, we use plain text files.

Toto was designed to be used with a reverse-proxy cache, such as Varnish.
This makes it an ideal candidate for heroku.

Oh, and everything that can be done with git, is.

how it works

content is entirely managed through git; you get full fledged version control for free.

individual articles can be accessed through urls such as /2009/11/21/blogging-with-toto

the archives can be accessed by year, month or day, wih the same format as above.

arbitrary metadata can be included in articles files, and accessed from the templates.

summaries are generated intelligently by toto, following the :max setting you give it.

you can also define how long your summary is, by adding ~ at the end of it (:delim).

dorothy

Dorothy is toto's default template, you can get it at http://github.com/cloudhead/dorothy. It
comes with a very minimalistic but functional template, and a config.ru file to get you started.
It also includes a .gems file, for heroku.

synopsis

One would start by installing toto, with sudo gem install toto, and then forking or
cloning the dorothy repo, to get a basic skeleton:

One could then create a .txt article file in the articles/ folder, and make sure it has the following format:

title: The Wonderful Wizard of Oz
author: Lyman Frank Baum
date: 1900/05/17
Dorothy lived in the midst of the great Kansas prairies, with Uncle Henry,
who was a farmer, and Aunt Em, who was the farmer's wife.

If one is familiar with webby or aerial, this shouldn't look funny. Basically the top of the file is in YAML format,
and the rest of it is the blog post. They are delimited by an empty line /\n\n/, as you can see above.
None of the information is compulsory, but it's strongly encouraged you specify it.
Note that one can also use rake to create an article stub, with rake new.

Once he finishes writing his beautiful tale, one can push to the git repo, as usual:

Where remote is the name of your remote git repository. The article is now published.

deployment

Toto is built on top of Rack, and hence has a rackup file: config.ru.

on your own server

Once you have created the remote git repo, and pushed your changes to it, you can run toto with any Rack compliant web server,
such as thin, mongrel or unicorn.

With thin, you would do something like:

$ thin start -R config.ru

With unicorn, you can just do:

$ unicorn

on heroku

Toto was designed to work well with heroku, it makes the most out of it's state-of-the-art caching,
by setting the Cache-Control and Etag HTTP headers. Deploying on Heroku is really easy, just get the heroku gem,
create a heroku app with heroku create, and push with git push heroku master.

$ heroku create weblog
$ git push heroku master
$ heroku open

configuration

You can configure toto, by modifying the config.ru file. For example, if you want to set the blog author to 'John Galt',
you could add set :author, 'John Galt' inside the Toto::Server.new block. Here are the defaults, to get you started: