Daniel Petersen's Blog

Documenting my struggle to make videogames, amongst other nonsense

Home Projects

Laughable Static Site Generator

I know what you’re thinking – This site is a huge piece of shit. Yeah, okay, maybe, but it was built with love. Well, love and a home built static site generator. Originally this site was using wordpress, and then I switched over to Octopress. Octopress is okay, but the gems it requires makes it a hassle to get up and running. I originally thought it was a Windows thing, but when I tried to get it up and running on my laptop which is on Linux, it also gave me trouble (though it was less trouble than with Windows). That was the last straw for me with Octopress.

I also wanted to customize the way my site looked, and wasn’t motivated enough to learn how to theme it after finding no existing themes for it that I liked. It’s also a pain to update your Octopress to a new version, as you’re currently instructed to clone their official git repository and modify it in place.

So I built a small script which copies everything in a source folder to an output folder. It’ll convert markdown files in the source folder to HTML, and then wrap those files around an HTML template that I created. It then starts a local server and monitors my source folder for changes, whereupon it’ll repeat the process of outputting the source folder to the HTML folder.

It’s a trivially small script, and only has 2 dependencies (kramdown to convert markdown to HTML, and filewatcher to detect changes to the source folder). I honestly don’t understand why Octopress needs so many gems when what we’re doing is basic. Admittedly my laptop is a piece of shit, but it took 10 minutes to install all the gems, and it couldn’t even finish that process without spitting out errors which I had to manually fix (thanks libv8). The script I made installs without fuss in seconds on Windows / Linux (presumably OSX as well but I don’t own a mac).

That said, the site and static generator are both still works in progress. I still need to (as of 3.27.16):

  • Display the number of comments for each post on the main page.
  • Categories exist for each post, but you wouldn't know it because there's no way to actually search and view posts via category. I need to do that...
  • I'd like to add support for an RSS feed. I've like 90% of the way there, but the output of the RSS feed is displaying as raw HTML rather than being formatted properly. Once I figure that out I'll push it live.
  • I deleted my youtube account, so any video that I was linking to in a project page is now defunct. I'm not sure what I'm going to do here. I'll probably end up rehosting them on youtube and fixing any broken links.
  • I'd like to release each finished project that I have, although this is such a low priority that it might not ever happen.
  • I'd also like to add a 'last updated' text to each Projects page.
  • I also need to make redirects work properly. At the moment danieljosephpetersen.com is just as valid as http://www.danieljosephpetersen.com. Ideally the former would redirect to the latter. Same goes for it-always-ends-in-nuclear-war.com

Copyright © - Daniel J. Petersen