name myu/mig
description Lua SSG
last change 2026-12-02
clone url
https://srcdump.net/myu/mig.git

commit briefs

8e711c6
myu be you  ·  2026-12-01
9d3e306
myu be you  ·  2026-11-24
5bed89b
myu be you  ·  2026-11-20
d23f04f
myu be you  ·  2026-11-19
e000f3d
myu be you  ·  2026-11-19
4a488a4
myu be you  ·  2026-11-19
b6b1d53
myu be you  ·  2026-11-17
ae804b8
myu be you  ·  2026-11-17

tree

readme

MIG(1) General Commands Manual MIG(1)

MIG — Mu's Idiotic Generator

./build.lua

the MIG utility is my personal static site generator. it was used for https://x11.fyi

MIG is written in lua, if you couldn't tell. mostly because i couldn't bear with /bin/sh anymore (won't say “sh” because that's le problematic media) and also for funsies.

the configuration is read from config.lua and it must return a table

all string variables in the config can reference any other variable using the {VARIABLE} (one curly brace on each side instead of two) syntax. this is le good because you can reference TITLE inside FOOTER or anywhere else in the config.

MIG depends on https://github.com/lunarmodules/luafilesystem, which must be built from source or installed via whichever package manager u are using when not on a musl libc OS. the lfs.so packaged with MIG will fail to load on non-musl systems.

the config variables are:

TITLE
the title of the site. supports any variable from config.lua
the html content to display in the footer. supports any variable from config.lua
INPUT
the source directory containing markdown files and templates. defaults to template
OUTPUT
the destination directory for generated html files. defaults to public
an array of filenames or directories to exclude from the generated navbar
IGNORE
an array of filenames or directories to not copy to OUTPUT
the format string used for nav links
LINKCURR
the format string used for the currently active nav link
AFTER
an array of shell commands to run after a successful build

MIG reads markdown files and puts the rendered html into template.html located in the INPUT directory

the templating "engine" supports:

replaced by the rendered markdown content
replaced by the automatically generated nav menu aka "le heckin werc sidebar"
replaced by the FOOTER variable from the config
includes the specified file into the template
conditionally renders the block if the variable is defined and not empty or false
conditionally renders the block if the variable is undefined, empty, or false (i have not fully tested the conditionals. they do work tho.)
replaced by the corresponding variable from config.lua

lua(1)

December 2, 2026 Linux 6.18.35-0-lts