A change of plans

Before I started coding, while still scribbling usage examples in my notebook, I summarized the idea I had for the project in a couple of slogans:

  • golb is a small, opinionated static site generator written in Go and inspired by Jekyll.
  • The golb blog is a blog about learning Go by implementing a blog generator.

This concept had a few problems:

  1. The golb name stank.
  2. Apart from stinking, it was evidence that the project lacked personality: its remarkable features were that it would be written in Go (an implementation detail) and that it would offer some blogging facilities (as was the case with every other static site generator).
  3. It was actually two projects in one: a site generator and a development blog. I knew from past experience that trying to keep a devlog while working on a project distracted me from the actual work on that project.

Wait, you may ask, isn’t this the devlog of the project? It is, but I cheated: I’m writing this retrospectively, after finishing most of the work I had planned for, based on a few notes I took during development and dumping thoughts I carried in my head for days.

I enjoy writing as much as building software so I’m always inclined to write about what I build; but writing is as absorbing and demanding as programming is to me: if I attempt both in parallel, the writing suffers and the programming suffers.

Not only does it take time and mental real estate away; writing as I build feels off for the same reasons that I don’t like to introduce abstractions or factor the code early on, or why test-driven development isn’t appealing to me: it forces me to focus on and get attached to specific solutions before being confident that they work —before fully understanding the problem I’m trying to solve.

But those problems that made me hesitant to start coding went away when I discovered that parsing org-mode files was feasible in Go. I had thrown in org-mode support as an optional, nice-to-have feature in my preliminary plan, not knowing what kind of work it entailed. But some googling revealed that Hugo already supports the org-mode syntax, relying on an external library that I could use too. First-class support of org-mode posts made a lot of sense for my project:

If I succeeded in making a tool that I wanted to use myself, maybe other people would find it useful too. There were plenty of methods to blog with org-mode already, and I imagined most Emacs hackers would prefer writing some elisp than using an external program, but there could be some value in a tool that allowed to:

  1. Start an org-mode-centric blog with a single command.
  2. Add org-mode to a pre-existing Jekyll blog with low configuration effort.

With this new goal in mind, I jumped into the work.



Namely: I had to define an org-publish project in my configuration to instruct Emacs how to export my org files; since the default org export produces documents of unconventional HTML structure (that, for example, are not properly parsed by browser readers), I had to export org to markdown and let Jekyll convert the markdown to HTML; I had to publish my org files separately for jekyll serve to pick up the changes; frequent operations like changing post titles and dates, and moving them out of draft required me to update two different filenames.