Kethel/2: A high level overview of a low-level SSG

I've been meaning to rewrite my old elixir-based SSG for a newer, and easier to set up alternative. So, what language is the most portable, has universal support across linux distributions? ISO/IEC 9899:1999, or The C Programming Language - of course!

Kethel isn't a perfect SSG by any means; it sometimes just writes garbled data to the output HTML fil if a template or TSV ends with a newline, is probably vulnerable to several buffer overflow attacks, as no bounds checking is implemented at all for the templates, and treats HTML as plain text, with only a strncmp "parser". Yet, it still works!
So, I'd like to explain some design decisions behind Kethel/2, and convince YOU to use less CSS in your website!

aggregate, and my "solution" to index page generation

Aggregate was the 2nd program I wrote for my site, which fills the spot of a 'compiler', if we're following the compiler/linker metaphor. The RSS feed generation for my site before was really iffy (RFC822 and RFC2822 are to blame). I could definitely have switched to atom feeds instead of RSS in the original kethel, but i had better things to do with my time then refactor all my elixir code. (this isnt an issue with elixir per se, but moreso that i didnt really wanna debug MY code every time i wanted to make a change to my site, architecturally kethel1 kinda sucked)

The general idea with aggregate is that you provide a TSV file, with some free-form data, and aggregate could transform that into an index page, but also an atom <entry>, with proper tag uri support. Coming back to the first sentence about the 'compiler' metaphor, aggregate does not generate the final html, but only take the TSV and generate a mkpage-compatible 'object page'. Since I've only used C in this project, I already had an obj folder for intermediate output, so it was easy to just generate all the indexes, and various feed entries, and use mkpage as an ersatz-linker, to generate the final XML/HTML.

So, what is this mkpage all about then?

mkpage is the original program that orchestrated all HTML generation, inspired by PHP's "it's just html!" approach, and my code editors unwillingness to let me use unclosed tags in a template file. I chose to use simple HTML comments with some meaning, which I then decode in C.

However, it quickly become clear that my linear-time no-seek approach to page generation wasnt really going to scale to, say, more than 2 pages in a directory. mkpage only supports 2 commands, LOAD and STAMP. LOAD takes a path, and puts the file's contents where the directive used to be. STAMP is used mostly for atom feed generation, but is generalised to work in most cases where you'd need a timestamp.

Therefore, aggregate deals with most of the more complex parts of my websites build pipeline. Aggregate supports a lot more commands, compared to mkpage.

So that's it, honestly

Besides some dependency modelling in make, this is all that Kethel2 comes with. I hope that you find some inspiration in my architectural choices here, and if not, i'll still keep enjoying my sub-halfsecond build times.

Merci d'avoir lu!