drafts.jsvine.com, at its core, runs on Jekyll, the open-source static site generator that’s generating evermore blogs these days.
In its standard configuration, Jekyll turns a folder full of text files into a website full of (something like) blog posts. But unlike typical Jekyll blogs, each of my drafts is its own Git repository, instead of just a single text file. This lets me keep track of changes to each draft separately, and to collaborate with other writers/editors on a post-by-post basis. To make this work, I’ve written a kludgy Jekyll plugin1 that I’ve named Gekyll. This plugin changes the Jekyll workflow in two keys ways:
Rather than use standalone text files, Gekyll ingests Git repositories, each corresponding to a post and each containing at least one such text file. The Grit library for Ruby, conveniently maintained by Jekyll’s lead developer, helps.
And rather than spit out only an HTML document for each post, Gekyll also renders the following files: a
git clone-able copy of the raw repo; the “raw” representations of the latest versions of each file in the repository; a JSON file representing each Git commit; and additional JSON files for each diff each of those commits.
Those JSON files let me display the list of changes at the bottom of each page. The interactive aspects of each page are mostly written in Backbone.js and its dependencies.
On January 14, 2013, I released version 0.0.1 of Gekyll on GitHub. If you’d like to incorporate Gekyll into your Jekyll project, but are having trouble with it, don’t hesitate to drop me a line.
Before mid-January 2013, it was an even-kludgier modification of the Jekyll library itself. ↩