A static site generator written in POSIX shell

(aashvik.com)

26 points | by todsacerdoti 5 days ago

7 comments

  • avian 14 minutes ago
    My first blog was made with NanoBlogger, which was what you would call a static site generator today. It's made in Bash.

    I remember setting up a few of these back in the day.

    https://nanoblogger.sourceforge.net/

  • vbezhenar 39 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...

    • lionkor 32 minutes ago
      A good way to do that with anything, I found, is a Makefile which downloads and compiles the few things it needs :D
    • qznc 26 minutes ago
      For GitHub just use Jekyll provided by GitHub itself?
  • msephton 14 minutes ago
    This is fun. I do love a good bit of shell scripting. Also makes me want to make my own little ssg in whatever way I see fit.
  • mrwh 2 hours 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...)
  • 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.
  • lombasihir 1 hour ago
    why not perl?
  • paseante 2 hours ago
    What is wrong with people.
    • harperlee 45 minutes ago
      Please have a moment to read the title of this site again :)
    • hereonout2 57 minutes ago
      I don't get this kind of indignation against anything shell related.
    • pixelatedindex 1 hour ago
      Care to elaborate? I don’t see anything of issue here, in fact it’s pretty good.