Skip to content

Blog, Revisited

I love programming so maybe programming/setting up new blog system is more of my things than to actually write blog, but anyway, I changed the blogging system, again.

The main motivation behind this change is not as technical as it was the last time. The main motivation is that I wanted to integrate this into my workflow.

I realised that the reason why I wasn’t writing a lot of blog posts. It’s because I wasn’t ready to create a content. Properly creating a content takes time and thought, and I find myself unable to devote that much time.

So one major reason of the change was to reduce this friction. I don’t know if it is working, but time will tell.

The History

I began blogging in 2013, as I wrote in the previous post, using WordPress.com platform. It works well, to a point, but I find that I cannot really get it to look the way I wanted, and I don’t really like WordPress.com interface. Especially the editor. I find WordPress.com (and more so WordPress.org) editors quite distracting.

Wordpress Blog
Blogging on Wordpress.com

Then, in 2016, I moved to static site generator. I was using Hugo, with a little custom theme based on PureCSS. I think it was Hugo 0.15 or 0.16 at that time.

1st Hugo Blog
First Generation Hugo Blog

Hugo was… nice. In a way. It is powerful, and can do a lot of thing. Markdown is a nice format for getting a content done. But the way Hugo (and most static site generators) works is to use a front-matter to specify metadata in each markdown file, and that was not nice.

First, front matter breaks many Markdown editor/previewer. I ended up just writing the post in vim, or later on, in WebStorm. Writing code is fine in those editors, but writing a non-code is just weird. The monospace font was not good for reading, and line width and word-wrap became a problem really soon.

I actually redesigned the blog to be more modern, once, when I was thinking of writing on multiple topics on the same blog.

2nd Hugo Blog
Second Generation Hugo Blog

It was my first web design in a long time, and admittedly it was… not that good. And I discovered something during development of this Hugo theme — the Hugo documentation is absolutely horrible.

I have written only single new post on this second-gen Hugo blog.

The Idea

I recently started handling all my notes, schedules, and todos via text file. (I might wrote about that later.) So I figure, if I were already writing, I could just write more using the same system.

So I began trying to write some blog post using my own format (which I am still using). It works, and it felt much better than WordPress or Hugo system.

But I also needed to convert those file into a website. And I began coding. For 2 days, it is completed, and it is what you are looking at right now.

The Technical Part

I am currently using GhostWriter to compose my Markdown documents. I want a format to look nice in the app too, so I create my own, simple metadata system. The header of this file looked like this:

# Blog, Revisited
!date 2020-05-06
!tags #tech #writing #web-design #blog

Then, I wrote a small program that reads all the Markdown document, and create a sqlite database containing the post (converted to HTML), the tags, and other metadata (like whether MathJax needed to be loaded). The program I wrote create new database every time it runs.

For displaying, I just wrote a simple PHP script to display post according to the sqlite database. It might not be as fast as a static site generator, but it is still very fast due to minimal processing needed.

I also create this new theme from scratch. I always want single-column blog, and this theme is actually based loosely on http://evenbettermotherfucking.website/. It is very light, responsive, and even have a nice print style sheet.

With all these, the publishing process become:

  1. Wrote new blog in Markdown
  2. Execute the program to compile the data
  3. rsync the new database and images up to the server.

Step 2 and 3 are combined into single bash file. And that’s it, a simple blogging system that integrated well into my workflow (hopefully).