Cobnetic (GitHub)
Cobnetic is a POSIX shell-script based static website generator, which operates on a simple structure of pages and templates. It theoretically supports using any language for templating.
Operation
Pages are files containing a header with variable metadata, followed by content
in Markdown format. The Markdown content will first be processed by running it
through Discount, after which dtepr is responsible for
inserting the page contents into the template. dtepr
directives in pages are
fully supported, and will be processed prior to the Markdown. The directives in
the template will be processed separately in a second pass, as the generated
page content is inserted.
See the example folder for a very small example site using a single template, and POSIX shell as the template processor.
Invocation
Invoke cobnetic
from a directory containing the site files. With default
behaviour, processing rules (environment variables) will be sourced from
cobnetic-site.rules
in the site root. Any files ending with .md.dte
in the
pages
directory will be processed using templates in the templates
directory, and the resulting HTML file will be put in the site
output
directory.
Default behaviour can be changed by setting one or more of the following environment variables:
CBN_SITERULES
: Path to source the site rules from. (cotnetic-site.rules
)CBN_OUTPUTPATH
: The directory to put the generated site files in. (site
)CBN_PAGES
: Directory containing Markdown pages to process. (pages
)CBN_TEMPLATES
: Directory containing template files. (templates
)CBN_STATIC
: Directory containing static files. If the directory exists, it and its contents will be copied unprocessed toCBN_OUTPUTPATH
. (static
)CBN_EXT
: Extension of files to process. (.dte
)
Language support
CBN_PROCESSOR
: Name of a shell function that writes a small executable processing program to stdout; this program is responsible for maintaining processing state between differentdtepr
invocations (so you can keep values in variables throughout the entire page/template). Two such processors are currently included;shell_processor
(the default) andpython_processor
. They can be used with your shell and with Python as the templating language, respectively.
Dependencies
(Python is currently required for creating the sender
that communicates with
the dtepr
processor.)