shuppy (@delan) [archived]

“let’s make a static site generator in shell scripts”, she said

shell script that uses ripgrep and sed to stitch together html files with the page title in the header and mtime in the footer, but first we have to check if we have gnu or bsd versions of stat(1) + date(1). for gnu we need “date -ud \@$(stat -c \%Y -- "$1") +\%FT\%RZ”, while for bsd we need “date -jr $(stat -f \%m -- "$1") +\%FT\%RZ”.

“it will be fun and lightweight”, she said

shuppy (@delan) [archived]

nabijaczleweli’s blogn_t.h, with a handful of html fragments in #define macros. for example, BLOGN_T_FOOTER() contains the words “[…] Nit-pick? Correction? Improvement? Annoying? Cute? Anything? Don'<!--'-->t hesitate to […]”, while HEADING_S(level, hid, style, ...) expands to “<h##level id=STR(hid) style>HEADING_LINK(hid) __VA_ARGS__</h##level>”.

tbh this fixed-function static site generator pales in comparison to @nabijaczleweli’s blogue, which uses the c preprocessor(!) to stitch together its html.

notice how Don't has to be spelled Don'<!--'-->t :)