Avatar Image
GitHub
rprospero
SourceHut
rprospero
Keybase
rprospero

Obligatory Meta-Post

Reading Time
4 Minutes
Word Count
747 Words
Published
Jul 22, 2021

By internet law, every blog most write about the software that they chose to write their blog. I had my own ridiculous set of requirements that I wanted to fulfil

  1. It needs to be a static site. All the hosting options that I'm examining are free static site hosts, so anything that required an actual framework (e.g. Wordpress, Django) was verboten.
  2. I want to be able to generate both a web site and a Gemini capsule from a single source of blog posts. This instantly ruled out most static site generators, since they have the code sense not to care about Gemini.
  3. Web visitors should have a web experience. By this, I mean basic stuff from the 90's, such as inline images and hyperlinks. This ruled out most Gemini-first site generators.
  4. It should be possible to write a post just by opening a text editor and typing my thoughts. Any solution that needs a command to create a post skeleton is unacceptable.
  5. I should be able to add input files in either Markdown or Org Mode. I'm more familiar with writing Org, but I would also like Markdown support.
  6. Creating the appropriate RSS and Atom files for newsreaders, since I know people are going to be so desperate to keep abreast of my latest rambling.

I specifically did not include the following goals

  1. Performance is always nice, but editing the site is something that I will do infrequently. If it takes a few seconds to do that, I can wait.
  2. Support for existing themes. I intend to make this site my own flavour of ugly.

Solution

Like a myriad programmers before me, I looked at the cornucopia of existing site generators and declared them all inadequate. I then engaged in the hallowed tradition of starting the project using a technology that I've never used before and don't have any friends or colleagues who could help me when I break something.

The specific system that I went with was Shake. It's a general, cross language build system written in Haskell. Because I'm a pretentious academic, the Haskell side of it already appealed to me. It also helps that I'm already quite familiar with the language. I was also aware of prior art for creating static site generators with Shake, so I'd be making the same mistake that others had made.

I wanted something based on a build system because a static site is largely a process of compiling a bunch of post "source" files into a bunch of page "executables". It was also comforting to know that, being in Haskell, Shake would be able to link with Pandoc, which is my personal favourite document converter.

Status

I've been working on the code for about six hours now while writing this and suffering from a fever that's likely impairing my judgement. Given that caveat, I've achieved objectives 1, 3, and 4. I cannot yet support Org files for writing posts. The reading of the Org files is trivial, but I haven't quite figured out how to get both Markdown and Org files to compile at the same time.

Adding Gemini support will be a larger issue. Pandoc does not currently have a Gemini writer, so I'll need to write my own. I've done it before, so I know how to do it. When I did it, I regretted the whole process. I'm going to pretend that it won't happen exactly the same way again this time.

I should also mention that, as I write this, I have done zero styling on the pages. In fact, I've stripped out some of the free styling that Pandoc provided for me, so I could almost argue that I have negative styling going on.

Update

So I've put another four hours into this site. As you can see, we have a theme now. You might want to write to me and comment that the theme is ugly. I'll counter that I use this on my machines on a daily basis, so you're going to have a difficult time convincing me. Also, my spouse helped make this for me. In all seriousness, though, if this colour theme is a significant readability issue for people, I have an uglier one already lined up. It's the colour scheme I used to use before this one was made for me.

More improtantly, there's also now Org support. I've even gone through the trouble of converting this post over to an Org file. That brings in goal 5.