Deploy A Free, Ruby Powered Blog In 5 Minutes with Toto and Heroku
Toto (GitHub repo) is a new lightweight Ruby and Rack-based blogging engine designed specifically for "hackers" by Alexis Sellier. Content is managed entirely through Git - so everything is version controlled - and articles are stored as text files with embedded YAML metadata. At only 300 lines, it's easy to hack to your own taste, too.
Alexis has decided to push Toto by demonstrating how easy it is to deploy - for free - on the Heroku platform. You can literally get a blog up on Heroku within 5 minutes, even if you haven't already got a Heroku account (I just tried it).
How To Do It
Here are the basic steps:
- Sign up for an account at Heroku.com - all you have to do is provide an e-mail address, validate it, then enter a password.
gem install heroku
git clone git://github.com/cloudhead/dorothy.git your-blog-dir
- cd your-blog-dir
heroku create
- Use the URL returned by
heroku create
and add a line in to theToto::Server.new
block inconfig.ru
like:set :url, 'http://your.heroku.url.here'
- git commit -am "Added URL"
- git push heroku master
- You're live!
It's that simple - I just tried it (see http://furious-fire-87.heroku.com for a live demo)! Beyond this stage, you need to check out Toto's documentation and actually add some posts to your Toto install, customize the template, and what not.
If you're interested in lightweight systems like Toto, check out Scanty and Jekyll (which includes a blog-like system but at heart is designed to cope with full sites).
February 5, 2010 at 9:08 pm
I did this last night on my site and it was pretty simple.
I've actually got it integrated into an existing rails site, and that was pretty straight forward too.
Basic steps are:
1.) create a folder in the root of your rails app for the blog...mkdir blog
2.) copy the articles and templates directory (and sub directories) from the dorothy example app over to that directory.
3.) Create a config.ru in your rails root.
4.) Fill in the rails root as appropriate. Mine looks like this:
5.) Add the toto and rdiscount gems to your .gems manifest or to your bundler gem file for heroku.
Then just deploy it to heroku and you should be good to go!
Enjoy.
February 5, 2010 at 9:25 pm
Awesome comment - just a shame WP cuts out the spacing, etc. I might try wrapping the code bits in PRE tags to see if it works..
February 5, 2010 at 10:16 pm
Just updated dorothy (the default template), to default to article.path instead of article.url, for links — this should make the `set :url` step optional.
February 5, 2010 at 11:54 pm
I've been playing around with toto for a bit now (cloudhead has shared with me the first few versions) and liked it so much I've decided to migrate my main blog over -- http://www.usabilitypost.com (DNS was only recently updated, so you may or may not see the toto version of the blog, I'm using OpenDNS and it loads the new site. You can tell if it's toto by the Disqus comments)
Migrated from WordPress without much pain. Extracted over 100 articles to text files and imported thousands of comments over to disqus (using their import plugin) and have just finished setting it up. Runs insanely fast on Heroku due to caching. Absolutely loving it. No need for WordPress ever again :)
February 6, 2010 at 1:41 am
This is just freakin cool...heroku is pretty slick too.
February 6, 2010 at 2:18 pm
what if you want to add stuff like SYNTAX highlighting
February 6, 2010 at 7:06 pm
@omnipresent: The most effortless option I found is to use gist.github.com's embed feature. Another reasonable option is rack-coderay http://github.com/webficient/rack-coderay which gives you a bit more flexibility.
But there are probably many other solutions as well.
February 6, 2010 at 10:25 pm
You could just hack support straight in to Toto, if you wanted. Fork it, add it, and see if the creator would like to pull it back - or not :-) The "syntax" gem would be good for this if you were focusing mainly on Ruby.
February 7, 2010 at 12:11 am
Does it write the blog for me too? Where can I get a gem for that?
February 7, 2010 at 12:32 am
jimbob: You want http://railstips.org/blog/archives/2007/04/29/lorem-ispum/ or http://github.com/glejeune/lipsum
February 8, 2010 at 7:59 am
I have a similar one I call blu.rb (except it's based off sinatra) It provides git backend, arbitrary layouts on any individual post, rss feeds and site update through post-commit hooks. I'm currently running http://prole.in off of blu.rb as well as this site http://vivekrajagopalan.com
It still needs to add caching and there are some loose ends that need to be tied up but it's working quite well for me as a blogging engine.
More info here http://prole.in/blog/A+Proletarian+Blogging+Engine.erb
February 9, 2010 at 2:51 am
Getting fairly tough to find a RELIABLE open source server these days! Thanks for the post! Fortunately, I found a GREAT company to use!
February 10, 2010 at 2:13 pm
Great! But before the Dorothy's dog was coded, Postview has born (http://github.com/hallison/postview). Try a demo in http://postview.heroku.com/.
Actualy, I'm working in a big refactor for v1.0.0.