commit briefs
tree
readme
| MIG(1) | General Commands Manual | MIG(1) |
NAME
MIG — Mu's Idiotic
Generator
SYNOPSIS
./build.lua |
DESCRIPTION
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
just
“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
- FOOTER
- 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
- NAVIGNORE
- an array of filenames or directories to exclude from the generated navbar
- IGNORE
- an array of filenames or directories to not copy to OUTPUT
- LINK
- 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
TEMPLATES
MIG reads markdown files and puts the
rendered html into template.html located in the
INPUT directory
the templating "engine" supports:
{{CONTENT}}- replaced by the rendered markdown content
{{NAV}}- replaced by the automatically generated nav menu aka "le heckin werc sidebar"
{{FOOTER}}- replaced by the FOOTER variable from the config
{{include "file.html"}}- includes the specified file into the template
{{if VARIABLE}} ... {{end}}- conditionally renders the block if the variable is defined and not empty or false
{{if not VARIABLE}} ... {{end}}- conditionally renders the block if the variable is undefined, empty, or false (i have not fully tested the conditionals. they do work tho.)
{{VARIABLE}}- replaced by the corresponding variable from config.lua
SEE ALSO
| December 2, 2026 | Linux 6.18.35-0-lts |