My fork of:
Go to file
c0dev0id 6278f5844e Add clean target 2022-12-24 08:35:57 +01:00
bin support per-directory metadata dir.meta 2022-11-19 23:22:49 +01:00
example Example layout refers to wrong css path 2017-01-04 10:42:39 +01:00
lib prevent variables from spilling out into global scope 2013-11-18 15:27:40 -05:00
LICENSE fixed email address 2011-09-22 11:43:18 -04:00
Makefile Add clean target 2022-12-24 08:35:57 +01:00 Typo in readme 2015-02-06 09:40:37 -05:00 change prefix to /opt 2022-11-19 23:21:43 +01:00


ZODIAC is a static website generator powered by sh and awk. The core features of zodiac are:

  • utilization of existing tools (i.e. awk, sh, find, etc.)
  • supports using plain html
  • built-in support for markdown
  • a simple, easy to use templating system
  • supports custom helpers written in awk
  • configuration, meta, helpers, etc. can be added as you need them
  • convert your markup using any external command that accepts a UNIX-style pipe (smu, asciidoc, discount, rst2html, etc)


zod projectdir targetdir


git clone git://

Edit the file to customize the install paths. /usr/local is the default install prefix.

Run the following (as root if necessary):

make install


A typical Zodiac project will look something like this:


And it's output could look like this:



.meta files contain a key / value pair per line. A key and its value must be separated by a ": ". A metafile looks like this:

this: that
title: Contact
author: Me

Each page can have its own meta file. The only requirement is that the meta file is in the same directory as the page, has the same name as the page and has the .meta file extension.

The optional global.meta file contains data that is available to all of your site's pages, like a site title.

Page metadata will always override global metadata of the same key.


Templates come in two forms, page templates and layout templates. Metadata can be bound to templates by using the {{key}} notation in your pages and layout files.

Page templates can have any extension that zodiac can convert. Out of the box, page templates can have an md, htm, or html extension. Other extensions and markup types can be supported if they are configured in the .zod/config file in the project directory.

The main.layout file wraps HTML content around a page template. A main.layout file could look something like this:

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    <link rel="stylesheet" href="/stylesheets/style.css" />
      <h1><a href="/">{{site_title}}</a></h1>
      <p>powered by static files, compiled by <a href="">zodiac</a>.</p>

{{{yield}}} is a special tag that renders the page content within the layout. {{{yield}}} can only be used in the main.layout file.


Partials are reusable snippets that can be included in different areas of your site. Partials must have the .partial extension and must be in the root of your project directory. Partials are called using two curly brackets and a greater than sign.


  {{> nav}}

  <p>Thanks for checking out my site!</p>

The nav.partial file could have the following contents:

    <li><a href="/">Home</a></li>
    <li><a href="/blog">Blog</a></li>
    <li><a href="/about">About</a></li>

This would make the above template expand to:


      <li><a href="/">Home</a></li>
      <li><a href="/blog">Blog</a></li>
      <li><a href="/about">About</a></li>

  <p>Thanks for checking out my site!</p>


The helpers.awk file is an awk script that can make custom data available to your templates. You also have access to the page and global data. Here is a peek at the script included in the examples folder:

{ helpers = "yes" }

function load_helpers() {
  # your custom data settings
  data["page_title"] = page_title()

# your custom functions
function page_title(  title) {
  if (data["title"]) {
    title = data["title"] " - " data["site_title"]
  } else {
    title = data["site_title"]
  return title

Just be sure to set the data array in the load_helpers() function at the top of the script to make your custom data available to the template.


For more control over the parsing and conversion process, a .zod/config file can be created within your project directory. Here is a sample config:


md      smu
txt     asciidoc -s -


Here we're only parsing (not converting to a different format) files matching *.htm and *.html.

Files matching *.md are going to be parsed and converted using the smu markdown parsing program.

Files matching *.txt are going to be parsed and converted using asciidoc.

Files matching Makefile will be ignored and not copied.

Conversion programs must accept a UNIX-style pipe and send converted data to stdout.


  • zsw: for the introduction to parameter expansion and other shell scripting techniques