Yet Another Static Blog Generator

Am I cool yet?

I wrote it in Tcl, to learn Tcl. It was fun. Tcl is fun.

If you’re interested for some reason, you can grab my (rather bad) code at git://git.dlom.cc/www (in the nop.djl.geek directory).

I might use it for other things, since it’s pretty easy to extend.

Here’s a description of how it works:

  1. The build script (build) sources build.conf, which contains some variables, namely:

  2. For each .post file ($srcdir/posts/*.post), apply that template, and write it out to $destdir/posts/*.html (I use discount in the template script so I can write posts in Markdown).

  3. For each .src file ($srcdir/*.src), apply template (I simply use Tcl’s subst command, to treat the file as a Tcl expression, allowing me to do things like generate an index of built post files).

At some point in the future I’d like to replace Markdown with some Tcl, so I can embed expressions, such as "I am [expr {[clock format [clock seconds] -format %Y] - 2001}] years old!" directly into text!

Overall, this was pretty fun. I definitely enjoyed Tcl as a loose shell-script like language, without any of the clunky quoting issues.

– $ djl@TravelMate $ 2020-05-10 $