sblg – simple off-line blog utility

Version 0.4.11, 2017-11-10

This is an example of an individual article. It consists of a template (article.xml) merged with article contents.

How does it work?

Posted by
Kristaps Dzonsons
on

It works like generating executables: with a Makefile like the one building this page (and the code) or by manual, cc(1)-like compilation. Click on file links to see the sequence—you'll get the point.

all: index.html index.html: index.xml article1.html article2.html: article.xml index.html: article1.html article2.html sblg -o $@ article1.html article2.html .xml.html: sblg -c -o $@ $<

Or in words, first build individual articles from a template with sblg -o article1.html -c article1.xml. Then knit together individuals into a templated front page with sblg -t index.xml -o index.html article1.html). The rest of this Makefile is dependencies. Not shown are Atom feeds: these use sblg -a atom.xml article1.html with a template just like the linking phase. See the sblg(1) manual for details.

Why do I do it like this? I prefer building articles individually, versioning the source with CVS, alongside templates for individual and linked articles. I let sblg do the work of putting it all together. Since most of my articles involve, for example, images built from gnuplot graphs, I already use Makefiles already to manage dependencies.