[0] For the curious - https://gist.github.com/RPGillespie6/b133854b8ebf5a983cf32c2...
[0] For the curious - https://gist.github.com/RPGillespie6/b133854b8ebf5a983cf32c2...
I did it in Rust, because I wanted to learn Rust.
It just takes a directory structure with markdown files, and converts each file to HTML while adding a header and footer. I use it on a few sites now, and honestly I should redo the code but it works conveniently and I have other stuff to do.
Oh, and my stack is nginx on Alpine currently.
Edit:
Code is here: https://git.sr.ht/~evan-hoose/SSSSS
It really is not great code. It even shells out to markdown to do the rendering - bad for all sorts of obvious reasons. (but the right choice for my use case).
If you want to use it, be my guest. Just know that it's bad and ugly and you could write it better yourself in not very long.
It handled the one potential HN hug-of-death event I've had without issues while running on the smallest DO droplet offered, and has basically been issue-free since I got it up and running.
I may very well do something similar at some point, though I've also thought about using it as an excuse to redo whenever I want to learn $LANGUAGE, or writing a markdown (or subset of markdown) interpreter at some point.
Definitely going to read through the code more closely as well - I've been meaning to find some short and well written Rust.
Why does this kind of "complex" matter? By all means code if you enjoy it, but it sounds like minutes of coding saved you seconds of installing something that already exists, and got you a setup that is less standard and so harder to maintain.
The real "complexity" that matters, as someone who has used most modern static site generators and front-end js frameworks, is in not knowing how or what broke, and how to fix it, when inevitably something breaks. E.g: with jekyll if you develop or modify content on a windows box, test locally, and then push to GH Pages, but Pages builds the site using unix, and some ruby gem or jekyll plugin doesn't work consistently across them, and it takes a good bit of experience and googling around the errors to find a fix or a workaround.
If you essentially made your own static site generator, at least you would know what went wrong and come up with the straightest line to the resolution (even if that's just modifying the build output by hand in an extreme case).
I'm not defending the decision, but I have worked with several folks who have this approach to using their own tools — and at times I lean in this direction too, until I have encountered breakages more often than I care to "understand them" by using my own tools — and hence trying to dissect the motivations behind that choice.