Qubyte Codes

About this blog


This blog took a long time to get started. Every time I tried to build it, I wound up focussed on some tech I wanted to use to host it. In the previous iteration, I even wrote a server framework. I took some holiday over the Christmas period, so I decided to throw everything away and make something minimal.

I chose to go with NGINX serving flat files produced by a static site generator. This is still me of course, and on my own time I like to allow myself to indulge in a little reinvention of the wheel, so I wrote the generator myself. It's about a hundred lines of code, mainly stitching together other small modules. I used Node to make the generator, with the following modules:

module explanation
front-matter For keeping YAML metadata at the top of post files.
marked To compile post markdown to HTML.
highlight.js To highlight code listings.
handlebars To render posts into templates and an index page.
remark To pluck the first paragraph from each post to render into the index page.
slug To make post URLs readable.
clean-css To compile CSS sources together.

Posts are markdown files committed to a git repo. I use the pre-commit hook to compile and add the rendered posts. At the moment I log into the server to pull changes down. I'll have that working on a GitHub hook soon.

I've no intention of posting the generator, since that would mean supporting it. It's strictly for my use. I've linked the modules above since they've been very useful to me. If you're thinking about setting up a blog and you're a programmer, I recommend this approach!