Blitz: Yet Another Static Site Generator

Published on October 15, 2017 under Projects

A small disclaimer: I was planning to write this article for a long time now, and somewhere between now and the time I released Blitz I've realised that this project was doomed from the start. Initially, this post was going to be about me telling you how cool Blitz is, but that didn't work. So now I'm just gonna tell you that Blitz happened, and it was great while it lasted.

There are times when I suffer from the NIH syndrome. Back in my high school days I used to write everything from scratch - I once even attempted to reinvent Photoshop using PHP (don't ask me how that went).

Throughout the years, my programming experience was growing and the amount of free time I had was shrinking, so I had to (forcefully) contain any NIH tendencies that I had. Luckily, that didn't always work! When I was working on the PEACH Reality project one of the requirements was to make a simple static website. That website would contain an overview of what we've done, user manual, and some other things, practically a bunch simple HTML pages with basic styling.

If you know me personally, you'd know that I'd never be satisfied with completing such a simple task without adding a bunch of all-nighter-worthy extra features. After trying a bunch of existing static site generators, I decided that none of them were worthy of being used by me. And this, ladies and gentlemen, is precisely how Blitz was born.

Blitz

Blitz Static Site Generator

The first version of Blitz was published on its GitHub on November 12, 2016. Since then Blitz got its own website - https://getblitz.io/ (which is now dead, obviously) and a bunch of updates. All 0.1.* releases had some nice basic functionality to them, but I never got to publishing 0.1.6+ which had all the cool features like advanced menus, IDs and so on. Instead, I was just keeping 0.1.6+ to myself and reaping all of its perks, har har har. You might also enjoy some trivia:

# Snippet from `blitz.yml` of a big website
pages:
  - uri: '/'
    content: 'overview.md'
    template: 'overview.pug'
    menus:
      - name: 'main'
        title: 'Overview'
      - name: 'overview'
        title: 'Overview'
    child_directories:
      - uri: '/'
        name: 'overview_pages'
        template: 'overview.pug'
        directory: 'overview'
        menus:
          - name: 'overview'
  - content: 'research.md'
    template: 'research.pug'
    menus:
      - name: 'main'
        title: 'Research'
      - name: 'research'
        title: 'Research Overview'
    child_directories:
      - uri: '/'
        name: 'research_topics'
        template: 'research.pug'
        directory: 'research'
        menus:
          - name: 'research'
# ... and it kept going for 100 more lines.

Conclusion

I absolutely loved writing Blitz. BUT I really, really, really had to limit the scope. My software engineering lecturer, Graham Roberts, would be disappointed by the amount of scope creep I have allowed. I would also definitely not use YAML again - if anything, I'd stick to JS-based config files so my users would get all of the perks of an actual programming language.

These 2 things aside, my main mistake was to allow the architecture to get super complex. I should've developed a nice, simple abstraction first and then develop the project around it, instead of doing it the other way around. All in all, Blitz was a great programming exercise.

Lesson learned, project abandoned.


End of Article

Timur Kuzhagaliyev Author

I'm a computer science graduate from UCL & Caltech, working as a systems engineer at Jump Trading. Before Jump, I was doing computer vision for Video Quality Analysis team at Amazon.