Using static websites as personal archives

Over coffee this morning, browsing my unreads in NetNewsWire, I stumbled on Simon Willison’s mention of Alex Chan’s “Using static websites as tiny archives” post. And then I saw Jeremy Keith also mention it. So I thought I’d mention it to!

There’s no web server, no build system, no dependencies, and no JavaScript frameworks. I’m writing everything by hand, which is very manageable for small projects. Each website is a few hundred lines of code at most.

This quoted bit is the key takeaway for me from Alex’s post. No web server! No build system!

When I was working on Tuff, my own personal static site generator that I used for about a year to create my personal website and a few other sites, I also began work on a local HTML website to browse my entire personal photo library.

My personal photo library is big. One terabyte and counting. But, using Tuff, I was able to generate a pretty good index to browse the archive by date and a few other ways. It took just seconds to parse the entire library to generate the site.

But I haven’t revisited the archive in over a year. Would it still work? Would it still build?

Not exactly. Or, at least not as easily as Alex. The HTML files are all there but I built Tuff in such a way as to rely on a web server (in my case Apache using Docker and mostly for cruft free URLs). So I can’t just open a single HTML file like Alex can or Jeremy can. It is easy to spin up a web server, but I’d much prefer Alex’s approach for these archives. Fortunately, this is a very easy update for me to make and so now this archive works off URLs that end in .html – the way Tim intended.

Then, I thought I’d try building a fresh up-to-date copy.

Well, I’m happy to report it worked. Tuff had to build several thousand new thumbnails but once that was done it created the archive in just 9 seconds.

I’d like to get away from a build process but I’m not sure I’d be able to. How does one write thousands of HTML files without a build process? But, I can simplify what Tuff is doing to make it much more future proof and single purpose. I’ll be looking into doing so to keep things as simple as possible.

Last updated:

Powered by Hubbub Pro+