News for hackers. Stuff that matters.
Re:“Make” as a Static Site Generator by envsubst on Sunday September 10, 2023 @09:56AM (#37455787)
Instead of `m4` or `sed` find and replace, the author should try `envsubst`. It's a program that replaces bash style variable references (for example `$TITLE`) with their value in the environment.

    export CURRENT="..."
    cat page.html | envsubt
Re:“Make” as a Static Site Generator by teo_zero on Sunday September 10, 2023 @11:02AM (#37456452)
The problem is that the $SOMETHING syntax is just too common if your site is a technical one, and you'll end up substituting too much.
Re:“Make” as a Static Site Generator by envsubst on Sunday September 10, 2023 @12:20PM (#37457308)
You can specify which variable names are valid, reducing the likelihood of a collision.
Re:“Make” as a Static Site Generator by karl42 on Monday September 11, 2023 @04:45AM (#37464549)
I agree that `envsubst` is a good choice for this. Unfortunately, it is not part of posix, so you can't rely on it being present everywhere. But as part of gettext, it is still very common.