The Personal Website of Jeremy Boles

Wattle

A multi-tool for weaving groups of files together.

Wattle works with groups of files, weaving collections of them into something new. It isn’t a static site generator; it’s the pieces for building your own in Lua. Which is what the word means, more or less: lengths of wood interlaced until they hold together as a fence.

How It Works

A project carries a wattle.lua defining three functions, which are also the three phases:

  • gather — work out which files are in play
  • process — collect their data and transform it
  • transform — write the output

The Lua API covers what that needs: file operations, Handlebars templating, Markdown, SCSS, YAML, image processing, HTTP requests, and shelling out to the system. There’s a development server too, with file watching and routing that serves index.html and adds .html extensions on your behalf.

Installation

For now the only way to install it is to compile it.

Prerequisites

Wattle is written in Rust and needs that toolchain, along with the LuaJIT and OpenSSL development libraries.

# Debian
sudo apt install cargo libluajit-5.1-dev libssl-dev

# Alpine
doas apk add cargo luajit-dev openssl-dev

# macOS
brew install cargo luajit openssl

Build from Source

git clone https://codeberg.org/jeremyboles/wattle.git
cd wattle
cargo build --release

The binary lands at target/release/wattle. There’s also a makefile that will put it in $HOME/.local/bin for you.

make
make install

Bookmarks