Bloggen
Why do so many programmers insist upon writing complex software? One example of something that shouldn't exist is the Content Management System. Why put into a database that which would be kept better on the file system? And, why put onto the web code that is hack-able, when one could instead only serve static pages? These ideas led me to create Bloggen: a static site generator that mostly gets out of the person's way.
Design
Bloggen was designed around the idea that post metadata is already in the file system, so that is used to generate static HTML pages. It was also designed to "get out of the way" and exists only in the Mac menubar. The basic components of the system are:
- Templating: handled by a special kind of archive file (BloggenTheme) that is registered with the OS once Bloggen is used.
- Publishing: back before there were any libraries to connect to AWS S3, one had to write their own, which meant generating cryptographic signatures to successfully upload stuff. I wrote that part to support S3, and then used shell utilities to support FTP, SCP, and rsync.
- Preferences pane: this is the screen where a user may define their blog, theme, and other settings
- Menubar entity: this is the only mode of interaction between a user and Bloggen
Written in Objective-C targeting Cocoa on Macintosh systems of the Lion era, it utilizes command-line tools shipped with the operating system to then transfer the files it generates. It uses file system attributes to tag posts and assemble an Atom feed: post title (file name), timestamp (last modification time), and body (Markdown, HTML, RTF, DOC, or text) are some examples.
The look and feel of a blog is configurable through a template system that utilizes plain files behind a MacOS archive format.
Posts may be uploaded to a server of the user's choosing via S3, SSH, rsync, or FTP. The S3 bit was tricky to write, because in those days there weren't any libraries that would help, so I had to learn about token authentication on a much deeper level.
I used Bloggen as a vehicle when I was learning to write OS X code. I designed the application around the OSX sandbox, which requires the user to explicitly cast permission to accessible directories (where the blog is). The sandbox is where HTML files are staged. This also leveraged OSX resource bundles, in order to ship the theme files. These gave the application an easy way of recognizing themes, and a user can doubleclick on a theme file to import it.
Because I wanted to put a lot of polish, I designed an icon and created all the associated imagery.
The code for Bloggen is available here. An example of a site generated with Bloggen is Cookies and Capacitors (where I used to write things).