Plan for the Blog

2017-04-05

I'm adding a small blog to the site. The idea is to have a place for posting about my projects and miscellany. Source files are written in plain text, and a script assembles the static HTML files from those. The way I see it, this gives me a simple way of adding updates without taking the step of configuring a web app framework.

Current schema

Source files and the script live outside of public_html. I'm using python for the build script and Markdown for the source entries. Right now, I'm having the build script call John Gruber's perl script from shell to process the source, but if I decide to do it from within python I'm sure I can find an implementation.

Problem: metadata

I would like to not think about metadata at all, but still have it available. For example, I want to have my blog entries reverse ordered by creation date, and maybe have the latest modification date posted if it differs from the creation date. Ideally, all of this should be handled by the build script. When I'm posting to the blog, I should just type and go.

My first thought was to use metadata from the filesystem. The problem I'm running into is that Linux doesn't expose file creation dates. I could just use modification dates, but then if I go back to fix a typo it could put my posts out of order, or I would have to manually retouch the modification date. While doable, this is too much work for simple everyday edits. As simple as I'm making this, I want it to just work.

This means implementing something in my script for tracking metadata. A pickled python dictionary will probably do, especially because it's what I already know. I can't help but think there should be a better way to do this, though.

Update: I found out that there have actually been a lot of changes to the pickle module since I last used it. In order to keep my info human readable, and to take advantage of the fact that git handles text files more efficiently, I'm going to go with the json package.