A static site generator written in POSIX shell
22 points
5 days ago
| 5 comments
| aashvik.com
| HN
vbezhenar
7 minutes ago
[-]
I wonder what would be a good way to generate a website with minimal software installations, for example in standard github runner image. This example uses comrak tool to process markdown into HTML.

I've come up with using Java and XSLT. Java is installed in Github Runner image and there's built-in XSLT support in Java standard library. You can write HTML and use XSLT to add header, footer and do other processings if necessary.

So basically I want to generate a website in github runner without accessing network to install something else.

I guess one could just `cat header.html content.html footer.html` but that requires a lot of tiny things like extracting title from content and inserting it into header, etc. Nothing that lots of greps and seds couldn't handle, of course...

reply
lionkor
1 minute ago
[-]
A good way to do that with anything, I found, is a Makefile which downloads and compiles the few things it needs :D
reply
mrwh
1 hour ago
[-]
Love it! My personal sites tend to start hand-written, evolve into a bash script, occasionally advance into python, but mostly just stay in bash, because it's convenient, doesn't need to please anyone else (nor would it!), and is already built for text processing into files. (I write a lot of scrappy shell scripts for my job too. I guess I should start asking an AI to generate whatever I want directly instead. Cobbling together a script is more fun though...)
reply
riedel
1 hour ago
[-]
The title seems to be a bit misleading IMHO because it does not really only use `sh` but heavily `sed` it seems, which is a whole programming language well suited for templating. I've in the old days written a Macromedia Dreamweaver compatible template engine using such a scheme, which I personally used quite a long time actually without Dreamweaver because this WordPress madness was even a thing.
reply
lombasihir
34 minutes ago
[-]
why not perl?
reply
oguz-ismail2
27 minutes ago
[-]
fell out of popularity lately
reply
paseante
1 hour ago
[-]
What is wrong with people.
reply
harperlee
13 minutes ago
[-]
Please have a moment to read the title of this site again :)
reply
hereonout2
25 minutes ago
[-]
I don't get this kind of indignation against anything shell related.
reply
pixelatedindex
30 minutes ago
[-]
Care to elaborate? I don’t see anything of issue here, in fact it’s pretty good.
reply