Blog Compiler

I began to feel trapped with Google's Blogger. I had written quite a few posts over the years and exporting them in a way I could self-host seemed like an impossible task. I still really wanted to continue the process of de-Googling myself though, so I started to think about alternative ways to blog.

The thought of using any other free blog provider felt like I'd just be swapping the Google cage for another one. True freedom would require I author my posts in a properly platform-agnostic way but the thought of authoring raw html made me feel sick.

Markdown seemed like a really nice content-authoring format, even though there are no universal standards for the syntax. However, there would still be the issue of authoring metadata like dates and tags for posts which markdown didn't seem like a good fit for.

So I decided to design a hybrid format which would be simple to author and yet cope with all the metadata. So I'm using a simple text file where a line beginning with a colon is a section-header (e.g. :tags) and the following lines are the data for that section. The 'content' section then contains markdown for the post itself. I can even have a separate file specifying the standard template for a page.

Then I got thinking about what annoys me so much about the modern web: that even loading a single page requires so many different requests to cdns and such for scripts, styles, fonts. It makes pages load so slowly, and even makes links suddenly jump down the page just as you're about to click on them! Grrr.

So I decided that instead of a server or client script interpreting the text file every time, I would write a program that would compile all the posts into html/css before I even upload them to the server. I could even pre-compile posts-by-tag and posts-by-month pages.

I don't really want to be uploading the entire site each time I add a new post though, so the build system needs some kind of incremental-upload system. For this, I generate a simple hash of each compiled file in the site and store all of them in a central file. That way, when generating an upload zip, the system can choose to only include the files that are new or have changed.