Problem solved, in a very UNIXy way!
for page in $pages;
$(which comrak) $page.md > $page.temp.html
cat header.template $page.temp.html footer.template > $page.html
pages.txt holds a newline separated list of the page names that I want to generate (index, codeofconduct, etc). We iterate over this list, using comrak (https://lib.rs/crates/comrak) to convert the MD to HTML, which is dumped in a temp file. The temp file is then `cat`ed together with the header and footer templates, which are just the top and bottom pieces of an HTML file.
omg I'd totally forgotten about `printf`! If nothing else, trying to get this tilde server off the ground has helped _me_ get better at doing things the UNIX way.
This is a server created by Jahziel Villasana (aka hapax). He's not sure what he's going to use it for yet...