Skip to content

Commit

Permalink
draft2
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Nov 17, 2008
1 parent fa3879c commit 1755224
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions posts/2008-11-10-blogging-like-a-hacker.textile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ On Sunday, October 19th, I sat down in my San Francisco apartment with a glass o

First, all my writing would be stored in a Git repository. This would ensure that I could try out different ideas and explore a variety of posts all from the comfort of my preferred editor and the command line. I'd be able to publish a post via a simple deploy script or post-commit hook. Complexity should be kept to an absolute minimum, so a static site would be preferable to a dynamic site that required constant maintenance. My blog would need to be easily customizable; coming from a graphic design background means I'll always be tweaking the site's appearance and layout.

Over the last month I brought these concepts to fruition and I'm pleased to announce "Conveyer":http://github.com/mojombo/conveyer. Conveyer is a simple, blog specific, static site generator. It takes a template directory (representing the raw form of a website), runs it through Textile and Liquid converters, and spits out a complete, static website suitable for serving directly with Apache or your choice of standard web servers. If you're reading this on the website (http://tom.preston-werner.com), you're seeing a Conveyer generated blog!

To understand how this all works, open up my "TPW":http://github.com/mojombo/tpw repo in a new browser window. I'll be referencing the code there.

Take a look at "index.html":http://github.com/mojombo/tpw/tree/master/index.html. This file represents the homepage of the site. At the top of the file is a chunk of YAML that contains metadata about the file. This data tells Conveyer what layout to give the file, what the page's title should be, etc. In this case, I specify that the "default" template should be used. You can find the layout files in the "_layouts":http://github.com/mojombo/tpw/tree/master/_layouts directory. If you open "default.html":http://github.com/mojombo/tpw/tree/master/_layouts/default.html you can see that the homepage is constructed by wrapping index.html with this layout.

You'll also notice Liquid templating code in thes files. "Liquid":http://www.liquidmarkup.org/ is a simple, extensible templating language that makes it easy to embed data in your templates. For my homepage I wanted to have a list of all my blog posts. Conveyer hands me a Hash containing various data about my site. I can find all my blog posts in <code>site.posts</code>. Each post, in turn, contains various fields such as <code>title</code> and <code>date</code>.

--

I've been blogging for eight years. Back in 2000, when I thought I was going to be a professional writer, I spent hours on LiveJournal doing writing practice with some of the other LJ denizens I'd befriended. After I came to my senses and refocused on web development, I installed MovableType and blogged extensively about web standards and design practices. MovableType eventually fell out of favor and I migrated everything to WordPress. As I started doing more print design work, code snippets died off and were replaced by illustrative images and diagrams. After discovering Rails, I coauthored a blogging system, shut down my old blog and started writing posts for my company. Upon moving to San Francisco and shutting down that company, it was off to a new domain and a new ruby blogging system called Mephisto. There I wrote almost exclusively about Ruby tricks and news about my open source software.

Over these eight years I've authored hundreds of posts and subsequently lost or misplaced nearly all of them. LiveJournal deleted all of my writing after a period of inactivity. I have archives of my other work scattered across several hard drives, half of which probably won't even spin up anymore. It seems I have some sort of blogging attention deficit disorder. I like to write, but I always end up shoe-horning myself into some tiny niche and then grow weary of the topic. Exacerbating the situation are the blogging systems themselves. I refuse to settle from some cookie cutter site template branded with some company's logo, so I'm forced into hosting my own blogging engine. Inevitably these tend towards complexity and obsolescence. I'm sick of maintaining these systems. I'm sick of losing my writing because it's off in some database that I haven't backed up for months. I'm sick of

On Sunday, October 19th, I sat down in my San Francisco apartment with a glass of apple cider and decided to start blogging again. But this time, I vowed, things would be different. No more losing data. No more complex blogging engines. No more comments. The question was, how do I do this?

There is static site generator written in Ruby called "webby" that caught my eye about a year ago. The idea is that you construct a "proto-site", consisting of content files, template files, and assets, that will be processed and converted into a static website. Drop this website into Apache and you're done.

This is a great idea, but webby is, by design, very generic. It does very little to help an aspiring blogger deal with the time consuming nuances of creating a competent weblog.

0 comments on commit 1755224

Please sign in to comment.