Making This
Nov 03, 2024 by @turgon@dosgame.clubI mean honestly would I have even gotten around to this if not for Cohost closing down? It's a bummer; Cohost was a pretty cool platform and community.
My goals were simple:
- self host, and
- stick with Markdown (which, regrets, maybe, idk), and
- be accessible
So I hunted around for static site generators and found Gozer by Danny van Kooten. I had just downloaded my Cohost content when I received an email from Flickr saying I was over the limit on private photos for a free account and they would be deleted soon. I haven't used my Flickr account since I stopped working there and my free Pro account got yoinked. Stars felt aligned so I grabbed a download of my photos as well.
For hosting I went with fly.io, and I set up a simple Dockerfile with the base nginx image. Later because the site has so many images, I layered the docker COPY
commands using COPY --exclude
so my builds would cache a lot better. And by following their instructions it was straightforward to set up a custom domain and certificates.
I wrote and rewrote my HTML and CSS. I tried stuff that seemed neat but looked out of place, and some things that I liked but turned out weren't very accessible. So I've pared things down, and honestly, it's good. HTML and CSS have come a long way since my glory days hand-typing them into production servers. Even though I have a lot of direct experience with these things, I felt like I was learning as I went, too. I was an empty vessel waiting to receive Grid Layout.
In the end, each page is just a header with meta and link tags, hopefully to make sharing nicer, and a body with the post content, followed by thumnails of all the recent posts. I was able to get simple dialog modals to work for expanding views of images, similar to Cohost's. It took a little bit of Javascript but there is no other JS on the site.
I scripted something in Go to transform the Flickr download's JSON files and images into gallery-like posts. It was pretty horrible! And there's still more to do describing albums and photos. The script generates the images and thumbnails, and markdown including modals. It even does geo location using Jerry Zhao's geo-golang with OpenStreetMap.
The slide rule posts from Cohost were tough because I foolishly chose to rewrite the math bits using MATHML. Hello, it's me, A FOOL DOING A FOOL'S FOOLERY. One eternity later dot gif, I had 'em.
Of course, it wouldn't be A Project without A Makefile.
I think that's all of the exciting stuff!