commit e840ed7

myu be you  ·  2026-11-20 19:35:39 +0000 UTC
parent ca4a617
what the fuck
1 files changed,  +3, -90
+3, -90
  1@@ -1,96 +1,9 @@
  2 .Dd $Mdocdate$
  3 .Dt MIG 1
  4 .Os
  5-.Sh NAME
  6-.Nm MIG
  7-.Nd Mu's Idiotic Generator
  8-.Sh SYNOPSIS
  9-.Nm ./build.lua
 10 .Sh DESCRIPTION
 11-the
 12-.Nm MIG
 13-utility is my personal static site generator. it was used for
 14+sources for the parody website
 15 .Lk https://xorg.fyi
 16 .Pp
 17-.Nm
 18-is written in lua, if you couldn't tell. mostly because i couldn't bear with
 19-.Pa /bin/sh
 20-anymore (won't say
 21-.Em just
 22-.Dq sh
 23-because that's le problematic media)
 24-and also for funsies.
 25-.Pp
 26-the configuration is read from
 27-.Pa config.lua
 28-and it must return a table
 29-.Pp
 30-all string variables in the config can reference any other variable using the
 31-{VARIABLE} (one curly brace on each side instead of two) syntax. this is le good because you can reference
 32-.Va TITLE
 33-inside
 34-.Va FOOTER
 35-or anywhere else in the config.
 36-.Pp
 37-.Nm
 38-depends on
 39-.Lk https://github.com/lunarmodules/luafilesystem ,
 40-which must be built from source or installed via whichever package manager u are using when not on a musl libc OS. the
 41-.Pa lfs.so
 42-packaged with
 43-.Nm
 44-will fail to load on non-musl systems.
 45-.Pp
 46-the config variables are:
 47-.Bl -tag -width Ds
 48-.It Va TITLE
 49-the title of the site. supports any variable from
 50-.Pa config.lua
 51-.It Va FOOTER
 52-the html content to display in the footer. supports any variable from
 53-.Pa config.lua
 54-.It Va INPUT
 55-the source directory containing markdown files and templates. defaults to
 56-.Pa template
 57-.It Va OUTPUT
 58-the destination directory for generated html files. defaults to
 59-.Pa public
 60-.It Va NAVIGNORE
 61-an array of filenames or directories to exclude from the generated navbar
 62-.It Va LINK
 63-the format string used for nav links
 64-.It Va LINKCURR
 65-the format string used for the currently active nav link
 66-.It Va AFTER
 67-an array of shell commands to ruun after a successful build
 68-.El
 69-.Sh TEMPLATES
 70-.Nm
 71-reads markdown files and puts the rendered html into
 72-.Pa template.html
 73-located in the
 74-.Va INPUT
 75-directory
 76-.Pp
 77-the templating "engine" supports:
 78-.Bl -tag -width Ds
 79-.It Li {{CONTENT}}
 80-replaced by the rendered markdown content
 81-.It Li {{NAV}}
 82-replaced by the automatically generated nav menu aka "le heckin werc sidebar"
 83-.It Li {{FOOTER}}
 84-replaced by the
 85-.Va FOOTER
 86-variable from the config
 87-.It Li {{include \&"file.html\&"}}
 88-includes the specified file into the template
 89-.It Li {{if VARIABLE}} ... {{end}}
 90-conditionally renders the block if the variable is defined and not empty or false
 91-.It Li {{if not VARIABLE}} ... {{end}}
 92-conditionally renders the block if the variable is undefined, empty, or false (i have not fully tested the conditionals. they do work tho.)
 93-.It Li {{VARIABLE}}
 94-replaced by the corresponding variable from
 95-.Pa config.lua
 96-.El
 97-.Sh SEE ALSO
 98-.Xr lua 1
 99+build using
100+.Lk https://srcdump.net/myu/mig