saait - the most boring static page generator

Meaning of saai (dutch): boring
Pronounciation:          site

Some parts are intentionally hardcoded, C knowledge is required.


Dependencies:
-------------
- C compiler (C99)
- libc
- requires non-standard field tm_gmtoff in struct tm.


Tested and works on:
--------------------
- OpenBSD
- Linux (glibc)
- Windows (mingw and cygwin)


Directory structure for pages:

- pages/file1.html
- pages/file1.cfg


Directory structure for templates:

- templates/<templatename>_item.ext
- templates/<templatename>_header.ext
- templates/<templatename>_footer.ext

The files are saved as output/<templatename>.ext

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

otherwise the directory name is used as the output file, for example
templates/atom.xml/templatefiles* will be: output/atom.xml

See config.h to modify the templates.


Cfg file and template syntax:
-----------------------------

Special variables set:
htmlfile (if not already set)	path to input HTML content filename.
filename (can be overwritten)	basename of output content HTML file.


Variables:
${}    escaped HTML/XML string.
#{}    literal string.
%{}    insert contents of file of variable value.


Usage:
------

1. Adjust the global config.cfg file which provides defaults for all pages.
2. Call saait from a directory that is providing a config.cfg and a
   templates folder. Those are included in the source, so simply call it from
   the source directory.
3. For each *.cfg file there has to be a corresponding *.html file with the
   same basename. They have to be placed in the same folder.
   optionally they can be overridden with the special variable "htmlfile".
4. Saait is called naming an output directory and providing one or more *.cfg
   files as parameters.
5. Modify the following two template files, in order to change the items
   displayed in the header (Blog, Git, Github, etc...):

  templates/page/header.html
  templates/index.html/header.html


Usage examples:
---------------

this is a basic example:

  $ saait -o /path/to/www /path/to/001-example.cfg

this is an example for how it's used in practice and for many pages:

  $ saait -o /path/to/www /path/to/*.cfg
