July 2023
The kobold is alive!
And kicking. And poking unlucky adventurers with a sharp obsidian spear. And serving content to whoever got so lost on the internet today to reach this dark, inhospitable corner of the indie web just to read a post with no useful content whatsoever.
I’m excited though. This is a major milestone in what has been a long journey which at the same time is only just starting. This website is not your usual GitHub pages template put together in an afternoon, you see, oh no. That would have been too easy.
I’m a code kobold, and yak troll shaving is what I do best.
I hurl myself down pitch black rabbit holes just to know whether there is something
shiny at the end or it was just a moon ray reflected by the exoskeleton of a fire bug.
I choose the path less traveled even when it is obviously less traveled for a very good reason.
I code my own static site generator from scratch, in a programming language I don’t know, and I am very specific about the quality of the end result.
The Kobold behind the codekobold
This tiny little website is built with Kobold, a simple Rust static site generator (SSG) that I wrote for this purpose.
As I found out along the way, there are three main ingredients to a usable SSG:
- first and foremost, obviously, parsing and processing each page’s content: text (Markdown text in the case of Kobold as well as many other SSGs) needs to be converted to the corresponding HTML. For a site like this one, an important part of this processing is the automatic application of syntax highlighting to code snippets. Kobold uses pulldown-cmark and syntect for these purposes, tying them together with the tiny homegrown crate highlight-pulldown.
- templating: each page’s processed HTML content (which makes up the page’s
<body>
) must be inserted in the appropriate HTML page template which takes care of adding a<head>
tag with pertinent metadata, adds CSS styling, decorates it with the site’s<header>
and<footer>
elements, etcetera. I decided to go full Rust and use Tera as the templating engine rather than something more mainstream such as Jinja or Liquid. - scripting: with the features above, I thought Kobold would already be usable (although bare-bones). However, I quickly realized I needed a way to automatically generate some of the site content, such as the tags page or the list of posts in the front page. I toyed with a few ideas and finally settled on leveraging the template engine’s own scripting facility (i.e. Tera macros) for this purpose.
These are basic features found in all mainstream static site generators, and of course I could have just used one of those. But the real treasure, dear reader, is all the stuff I learned along the way.
Well, the real treasure obviously is the golden trove of Shan’tya, deep down in the fungi-lit caves under the seven levels of the abandoned city of Tartarus. But you know what I mean.
Blogging in style
A static site generator does not provide a theme for the website, so I designed the look and feel that you can’t take your eyes off of from scratch.
Well, kind of. mvp.css provided a good set of initial defaults, and the site’s color scheme is heavily based on the Nord theme, which I find so soothing as it reminds me of the frigid landscapes of Baladhur, a place many a generation of code kobolds have called their home.
I try to keep the design minimalist but modern, inspired by other sites oozing personality such as
Like all kobold caves, this website is designed to last.
You are safe here
There are no targeted ads here, no analytics, no cookies, no subscription pop-ups. A good web is possible. Pages can load quickly without much engineering. CSS minification is a lie, the bloat most often comes from features you don’t need nor want.
What now?
We kobolds are social creatures in our own weird, awkward way. I do not see the appeal of mainstream social media (in fact I find most of its defining features jarring), but I’m looking forward to join the loose clan that is the indie web: I align with much of its philosophy.
I am also looking forward to have a home for notes and musing about things I care about: writing is how I think most clearly, teaching is one way of learning, stating an opinion on the web is the best way to discover all the ways your opinion is wrong.
You can find more information about me and this website in the about page.