4 ms·
My static site generator is 5500 lines of Java, because the only thing I hate more than software I didn't invent myself is technologies that are fashionable ;-)
by marginalia_nu 5y ago
My static site generator is 5500 lines of Java, because the only thing I hate more than software I didn't invent myself is technologies that are fashionable ;-)
- rpastuszak 5y agoSure, but you could build the same thing with <100 LOC, in JS, 10 years ago. What I’m trying to say is that even if this qualifies as fashionable in your time scale, a decade is a lot. This isn’t criticism of your approach. It’s better to stick to whatever works for you and focus on the problem domain rather than the tech stack.
- marginalia_nu 5y agoTo be fair, 10 years is still uncomfortably modern in my book. My tech needs to at least be old enough to drive a car. Ideally it should be old enough to have an existential crisis about how its life is turning out. ... and you can probably build a 100 LOC static page generator in Java as well. My thing does a lot of weird crap, though. Like it also acts as a Gemini protocol server, you can publish from the web and it pushes every change to a git repo. It also tracks backlinks and re-publishes every page that is mentioned. It also renders from a specialized version of gemtext so there really isn't any standard libraries to use (that I'm aware of).
- rpastuszak 5y ago> .. and you can probably build a 100 LOC static page generator in Java as well. Hehe, given how verbose Java can get, I’d increase the word wrap limit x3 in that case. But yeah, I see your point and the project sounds pretty cool. Can I find it anywhere?
- marginalia_nu 5y agoMy dude, them's fighting words. So I built a SSG in 50 lines of mostly idiomatic Java (one line is a bit squished, but 52 just doesn't sound as cool): https://github.com/vlofgren/50-line-java-ssg https://github.com/vlofgren/50-line-java-ssg Does deal with partials, bit stuff like an automatic index requires maybe 5-10 additional lines. Took about an hour (plus 15 minutes to try to figure out how to get into my github account, which I haven't actively used in the last 15 odd years). My "real" Java SSG is used to generate https://memex.marginalia.nu/ https://memex.marginalia.nu/. Unfortunately I don't have the source published.
- malkosta 5y agoI liked!
- malkosta 5y agoHere is the shortest I can get while keeping markdown support - 3 lines, with 1 dependency: for file in *.md; do pandoc --quiet --template layout.html $file -o "${file%.*}.html" done
- marginalia_nu 5y agoYou're wearing out your enter key my man $ find -maxdepth 0 -name \*md -exec sh -c 'pandoc --quiet --template layout.html "$0" -o ${0%.*}.html' {} \;
- malkosta 5y agoHahaha cool!