A static site generator written in POSIX shell
13 points by aashvik
13 points by aashvik
A walk through the design, tradeoffs, and questionable sed / eval of the POSIX shell script that builds my blog.
I feel like somewhere there is a missed opportunity for abstraction: if using envsubst and comrak are okay, then why stop there?
Introducing frontenv that converts frontmatter into variable assignments would make handling frontmatter much less brittle, then follow up with something that allows you to create html components, etc and drive it all from gen.sh is very much in the spirit of using a command language.
It forces you to abstract :)
Fair -- but this script is intentionally site-specific. The lack of abstractions is a feature to me.
A web framework written in shell sounds cool (and exists!), but something like a component library defeats the goal for my website. I see an avoided opportunity for accidental complexity here -- I'm happy to be free to not abstract, as I want to template in handwritten HTML :)
(Still, I later did make the frontmatter format less brittle, and edited the post to match!)