4 ms·
The reason why there are so many static site generators is that they are trivial to write (which is why making your own is a good beginner coding project):
by snicker7 8y ago
The reason why there are so many static site generators is that they are trivial to write (which is why making your own is a good beginner coding project):
for {post}.md in in blogdir:
if timestamp({post}.html) < timestamp({post}.md):
convert_md_2_html({post}.md)
- Spivak 8y agoThat's a good explanation for why there are so many SSGs on Github but it doesn't explain why there are so many in use. Surely someone talented would put all the pieces together and outshine all the hobbyist projects but it hasn't happened yet. So either something is in the way or the problem domain is harder than you describe.
- toxik 8y agoThis looks a lot like a Make rule to me. %.html: %.md generatehtml $^ >$@
- creatornator 8y agoI've actually experimented a bit using make+pandoc as a static site generator/pdf compiler. It semantics of make actually transfer pretty well.
- flukus 8y agoHere's a slightly more involved but still incredibly simple one I put together: https://flukus.github.io/building-a-blog-engine.html https://flukus.github.io/building-a-blog-engine.html Turned out a hell of a lot faster than any static site generator I've used.
- toxik 8y agoThose who are unaware of history is doomed to repeat it, eh. I use makefiles for a lot of things, they're very straight-forward. If you just follow the UNIX design philosophy, your programs are going to be makefile-useable anyways.
- setr 8y agoIn fact, I’m doing that right now! Mostly because I want a blog with a graph structure for linking, and most assume you just want a tree of categories, with tags as a seperate set of trees, usually with a depth of one. And it mostly just boils down to those 3 lines, with some additional support for the graph structure (and to force the urls to reflect the path taken, symlinks for all possible paths)