All Projects → nuex → Zodiac

nuex / Zodiac

Licence: mit
A static website generator written in awk and sh.

Programming Languages

awk
318 projects

Projects that are alternatives of or similar to Zodiac

Fornax
Scriptable static site generator using type safe F# DSL to define page templates.
Stars: ✭ 175 (-13.37%)
Mutual labels:  static-site-generator
Nikola
A static website and blog generator
Stars: ✭ 2,221 (+999.5%)
Mutual labels:  static-site-generator
Quokka
LOOKING FOR NEW MAINTAINER - Quokka is a Content Management System - `docker run --rm -it -p 5000:5000 quokka/quokka`
Stars: ✭ 2,198 (+988.12%)
Mutual labels:  static-site-generator
Lego
A fast static site generator that generates optimised, performant websites.
Stars: ✭ 176 (-12.87%)
Mutual labels:  static-site-generator
Monobase
React static site generator
Stars: ✭ 180 (-10.89%)
Mutual labels:  static-site-generator
Gatsby Docker
Develop & Build GatsbyJS static sites within Docker.
Stars: ✭ 184 (-8.91%)
Mutual labels:  static-site-generator
Baumeister
👷 The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (-15.35%)
Mutual labels:  static-site-generator
Gulp Webpack Starter
Gulp Webpack Starter - fast static website builder. The starter uses gulp toolkit and webpack bundler. Download to get an awesome development experience!
Stars: ✭ 199 (-1.49%)
Mutual labels:  static-site-generator
Nanogen
Minimalist static site generator in Node.js
Stars: ✭ 180 (-10.89%)
Mutual labels:  static-site-generator
Staticsitegenerators List
A comprehensive, partially automatically generated comparison of static site generators
Stars: ✭ 190 (-5.94%)
Mutual labels:  static-site-generator
Saber
()==[:::::::::::::> Build static sites in Vue.js, without the hassle
Stars: ✭ 2,133 (+955.94%)
Mutual labels:  static-site-generator
Vanilla Back To Top
Simple and smooth Back To Top button
Stars: ✭ 179 (-11.39%)
Mutual labels:  static-site-generator
Post Scheduler
Schedule posts & content updates for static websites (Jekyll, Hugo, Gatsby, Phenomic etc)
Stars: ✭ 184 (-8.91%)
Mutual labels:  static-site-generator
Bedrock
Bedrock is a static site generator to create large-scale HTML prototypes and document design systems
Stars: ✭ 175 (-13.37%)
Mutual labels:  static-site-generator
Firn
Org Mode Static Site Generator
Stars: ✭ 198 (-1.98%)
Mutual labels:  static-site-generator
Pygreen
A micro web framework/static web site generator.
Stars: ✭ 171 (-15.35%)
Mutual labels:  static-site-generator
Gulp Site Generator
A static site generator using Gulp
Stars: ✭ 183 (-9.41%)
Mutual labels:  static-site-generator
Clayoven
💎 beautiful website generator for math, code, and articles
Stars: ✭ 200 (-0.99%)
Mutual labels:  static-site-generator
Jamstack Web Starter
Static website workflow utilising Eleventy, Tailwind CSS, Webpack and PostCSS.
Stars: ✭ 198 (-1.98%)
Mutual labels:  static-site-generator
Bael Template
Brutalist Blog theme for Netlify CMS
Stars: ✭ 187 (-7.43%)
Mutual labels:  static-site-generator

zodiac

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)

SYNOPSIS

zod projectdir targetdir

INSTALL

git clone git://github.com/nuex/zodiac.git

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

Run the following (as root if necessary):

make install

DESCRIPTION

A typical Zodiac project will look something like this:

site/
  index.md
  index.meta
  main.layout
  global.meta
  projects/
    project-1.md
    project-1.meta
    project-2.md
    project-2.meta
  cv.md
  cv.meta
  stylesheets/
    style.css

And it's output could look like this:

site/
  index.html
  projects/
    project-1.html
    project-2.html
  cv.html
  stylesheets/
    style.css

Meta

.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

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">
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="/stylesheets/style.css" />
    <title>{{page_title}}</title>
  </head>
  <body>
    <header>
      <h1><a href="/">{{site_title}}</a></h1>
    </header>
    <article>
      {{{yield}}}
    </article>
    <footer>
      <p>powered by static files, compiled by <a href="http://nu-ex.com/projects/zodiac">zodiac</a>.</p>
    </footer>
  </body>
</html>

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

Partials

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.

<body>
  <h1>Welcome!</h1>

  {{> nav}}

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

The nav.partial file could have the following contents:

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

This would make the above template expand to:

<body>
  <h1>Welcome!</h1>

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

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

Helpers

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.

Config

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:

[parse]
htm,html

[parse_convert]
md      smu
txt     asciidoc -s -

[ignore]
Makefile

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.

CREDITS

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

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].