Saait: a boring HTML page generator

Last modification on

Saait is the most boring static HTML page generator.

Meaning of saai (dutch): boring. Pronunciation: site

Read the README for more information about it.

I used to use shellscripts to generate the static pages, but realised I wanted a small program that works on each platform consistently. There are many incompatibilities or unimplemented features in base tools across different platforms: Linux, UNIX, Windows.

This site is created using saait.


  • Single small binary that handles all the things. At run-time no dependency on other tools.
  • Few lines of code (about 575 lines of C) and no dependencies except: a C compiler and libc.
  • Works on most platforms: tested on Linux, *BSD, Windows.
  • Simple template syntax.
  • Uses HTML output by default, but can easily be modified to generate any textual content, like gopher pages, wiki pages or other kinds of documents.
  • Out-of-the-box supports: creating an index page of all pages, Atom feed, twtxt.txt feed, sitemap.xml and urllist.txt.


  • Simple template syntax, but very basic. Requires C knowledge to extend it if needed.
  • Only basic (no nested) template blocks supported.


git clone git://

Download releases

Releases are available at:

Documentation / man page

Below is the saait(1) man page, which includes usage examples.

SAAIT(1)		    General Commands Manual		      SAAIT(1)

     saait  the most boring static page generator

     saait [-c configfile] [-o outputdir] [-t templatesdir] pages...

     saait writes HTML pages to the output directory.

     The arguments pages are page config files, which are processed in the
     given order.

     The options are as follows:

     -c configfile
	     The global configuration file, the default is "config.cfg".  Each
	     page configuration file inherits variables from this file.	 These
	     variables can be overwritten per page.

     -o outputdir
	     The output directory, the default is "output".

     -t templatesdir
	     The templates directory, the default is "templates".

     A recommended directory structure for pages, although the names can be

     The directory and file structure for templates must be:

     The following filename prefixes are detected for template blocks and
     processed in this order:

	     Header block.

	     Item block.

	     Footer block.

     The files are saved as output/<templatename>, for example
     templates/atom.xml/* will become: output/atom.xml.	 If a template block
     file does not exist then it is treated as if it was empty.

     Template directories starting with a dot (".") are ignored.

     The "page" templatename is special and will be used per page.

     A config file has a simple key=value configuration syntax, for example:

     # this is a comment line.
     filename = example.html
     title = Example page
     description = This is an example page
     created = 2009-04-12
     updated = 2009-04-14

     The following variable names are special with their respective defaults:

	     Path to the input content filename, by default this is the path
	     of the config file with the last extension replaced to ".html".

	     The filename or relative file path for the output file for this
	     page.  By default the value is the basename of the contentfile.
	     The path of the written output file is the value of filename
	     appended to the outputdir path.

     A line starting with # is a comment and is ignored.

     TABs and spaces before and after a variable name are ignored.  TABs and
     spaces before a value are ignored.

     A template (block) is text.  Variables are replaced with the values set
     in the config files.

     The possible operators for variables are:

     $	     Escapes a XML string, for example: < to the entity &lt;.

     #	     Literal raw string value.

     %	     Insert contents of file of the value of the variable.

     For example in a HTML item template:

		     <h1><a href="">${title}</a></h1>
			     <strong>Last modification on </strong>
			     <time datetime="${updated}">${updated}</time>

     The saait utility exits 0 on success, and >0 if an error occurs.

     A basic usage example:

     1.	  Create a directory for a new site:

	  mkdir newsite

     2.	  Copy the example pages, templates, global config file and example
	  stylesheets to a directory:

	  cp -r pages templates config.cfg style.css print.css newsite/

     3.	  Change the current directory to the created directory.

	  cd newsite/

     4.	  Change the values in the global config.cfg file.

     5.	  If you want to modify parts of the header, like the navigation menu
	  items, you can change the following two template files:

     6.	  Create any new pages in the pages directory.	For each config file
	  there has to be a corresponding HTML file.  By default this HTML
	  file has the path of the config file, but with the last extension
	  (".cfg" in this case) replaced to ".html".

     7.	  Create an output directory:

	  mkdir -p output

     8.	  After any modifications the following commands can be used to
	  generate the output and process the pages in descending order:

	  find pages -type f -name '*.cfg' -print0 | sort -zr | xargs -0 saait

     9.	  Copy the modified stylesheets to the output directory also:

	  cp style.css print.css output/

     10.  Open output/index.html locally in your webbrowser to review the

     11.  To synchronize files, you can securely transfer them via SSH using

	  rsync -av output/ user@somehost:/var/www/htdocs/

     The most boring static page generator.

     Meaning of saai (dutch): boring, pronunciation of saait: site

     find(1), sort(1), xargs(1)

     Hiltjo Posthuma <>