What’s Under the Hood?

Many months ago, a buddy sent me this article written by Kyle Rush about the technology stack behind the Obama campaign’s fundraising platform. Kyle mentioned Jekyll, a static site generator written in Ruby, and recommended giving it a whirl to create fast, simple websites without the need for a bloated CMS.

I’m not a Ruby guy, and despite making an attempt to get things working properly on my Mac, I backed out of the rabbit hole and instead decided to give Pelican a try. It’s written in Python, and uses the Jinja2 templating language.

To get up and running, I followed this handy (but now outdated) guide by Martin Brochhaus. (Note: Here’s Martin’s updated guide.)

After getting everything configured and deployed to Github Pages, I started working on an ugly theme based off the default Pelican template. I never finished it. Then, What Cheer announced our transition to Pack, and things got pretty busy for a while.

Fast-forward six months

I picked things up again a couple weeks ago after reading about the updates to Pelican. I began piecing together this current theme using Bootstrap. (I haven’t worked with any other front-end frameworks, but I’ve been using it on some stuff I’m building with Pack, and also a Yearbook project for the PTA.) I like it. Since the bulk of my front-end development happened between 1996 and 2004, it’s allowed me get back in the game pretty quickly.

A complete list of tools

  • Pelican - A static site generator written in Python
  • Jinja2 - A templating language for Python used to create Pelican themes
  • Markdown - A lightweight markup language to quickly write content
  • Bootstrap - A front-end framework - helpful for responsive development
  • Google Fonts - For nicer fonts
  • Pygments - For syntax highlighting
  • Typogrify - To fancy up the text a bit
  • Fabric - To streamline deployment
  • Github Pages - Fast, reliable hosting

The process

Install Pelican

Again, here’s Martin Brochhaus’ updated guide.

Create your first post

Include your metadata at the top. (More here)

Title: What's Under the Hood?
Date: 2013-06-22
Summary: From Markdown to static HTML, by way of Pelican, Jinja2, Bootstrap, and more.
Slug: whats-under-the-hood
Tags: Pelican, Boostrap, Github

Many months ago, [a buddy](http://christopherkollars.com) sent me ...


I use two separate config files for Pelican. One uses relative URLs (so I can preview locally), and the other generates absolute URLs for production. To avoid typing the full Pelican commands to generate the output, I use this fabfile.py:

"""Fabric tasks for generating HTML"""
from __future__ import with_statement

from fabric.api import lcd, local, settings

def pub():
    """Re-generates the output using absolute urls."""
    local('pelican . -o ../ -s settings.py')

def dev():
    """Re-generates the output using relative urls."""
    local('pelican . -o ../ -s local_settings.py')

Preview locally

fab dev

Then I check it out on my local vhost.


If everything looks okay, I generate the HTML with absolute URLs.

fab pub

Then simply commit my changes to Github.

So far, so good

I’m the kind of guy who will spend 15 hours hacking my Wii to play 15 minutes of old NES games. I’m optimistic that an easy, fast, and fun way to manage a new blog will encourage me to get my act together and finally start writing somewhat regularly.

Get the theme

Fork the current version of this theme on Github. It really wasn’t built with with sharing in mind, but you’re free to use what you can!