Compass Navigation Streamline Icon: https://streamlinehq.com
applied cartography

How the media library works

I've received a number of questions as to how the media library part of this blog works, and I figure it's worth a bit of time to explain — even though there frankly is not that much to explain.

The soul of the thing is that each media item is a markdown file, just like the posts themselves. Here, for example, is a recent one, for Jay Kelly:

---
title: Jay Kelly
type: Movie
date: 2026-06-30
rating: 5
year: 2025
director: Noah Baumbach
status: Finished
image: jay-kelly.jpg
tags:
  - movie
colorSortKey: [0, 22, 0]
---

> I was young. I wanted something very badly and I was afraid that if I took my eye off it, I wouldn't have it. And I was right. There was no other way to do it. And it meant choosing it over you. But it was always meant to be temporary. Just until I got what I wanted... But then I had to keep it.

I am reminded of the other recent George Clooney vehicle, <a href="/posts/wolfs.html">Wolfs</a>: this is self-indulgent in one dimension, and its merits are almost entirely carried by the efforts of Sandler and Clooney, both of whom give very strong performances which rescue the film from being Bad but do not carry it to greatness.

I also found myself wondering what Baumbach is up to right now. The script and direction here seem entirely *thoughtless* — not so bad as to be offensive, but neither interesting nor characteristic of his earlier and better work. I can dismiss things like the scattershot tone or the half-hearted performances from Laura Dern et al. as being intentional -- it is an ethereal, dreamlike film.

But the movie fails to do what I think it needed to do, which is to make us feel bad -- or novel in _some_ kind of way -- for either character, even if for an instant.

Clooney plays a very light pastiche of himself: if you interpret the film as a story about Clooney himself, you are forgiven for doing so because he so comfortably eases into that role of charm and conviviality. He is a man who made it big, and in so doing had two lovely daughters who care little for him due to his absence -- an absence that he chose, time and time again, until there was no other choice to make.

(And much of the same criticism -- if it can be called that -- can be levelled at Sandler's character, who is a very realistic depiction of a guy worth millions of dollars whose biggest problem is that nobody will say "I love you" to him.)

I watched <a href="/posts/Somewhere.html">Somewhere</a> earlier this year, and I think many parallels (Hollywood people and their Hollywood problems!) can be drawn between the two films, but the success of _Somewhere_ is in what I called "the wattage and nuance of Dorff and Elle Fanning's performances"; both together and in isolation the two performances there stirred something beyond artifice in me in a way that Jay Kelly did not.

---

Lastly, the ending.

I really think the story of this film is that Baumbach — and Emily Mortimer, as co-writer — came up with the final scene and the final line, and then worked their way backwards from it into a movie. And to a small extent, that worked: the final scene, and the final line, cliche as it is, smashes me to bits. But it feels cut from a different movie -- a different life! -- than the one I spent two hours watching.

The front matter is, of course, the most interesting bit to talk about. Most of it is self-explanatory, with the exception of the status, which is what governs the answer to the question: should this be published?

A quick aside on the color sorting. The grid is arranged by the dominant color of each cover, which I extract at build time and cache back into the front matter — that's the colorSortKey field above. It's the one bit of genuine cleverness in here, and mostly it just makes the grid pretty.

Beyond this, every other bit of functionality can be abstracted away into things you can do once you have a JSON blob. The media grid at the bottom of the splash page is just vanilla JavaScript. Deep linking, or wiki linking, to other reviews is handled through a bespoke build-time mechanism — but nothing you wouldn't be able to figure out from first principles, since it's the exact same logic as for how it works for blog posts.

I've iterated on a number of different approaches over what is now, literally, more than a decade of keeping this little library. And if there's one ground truth that I hold dear above anything else, it is the primacy of flat files. They are portable, fungible, and legible.

I lose out on a couple of small idiosyncrasies. For instance, I can't trivially add new things from my phone — which sounds like a pain point, but any solution to the pain point would indirectly induce much more pain than it solves.


About the Author

I'm Justin Duke — a software engineer, writer, and founder. I currently work as the CEO of Buttondown, the best way to start and grow your newsletter, and as a partner at Third South Capital.

Colophon

You can view a markdown version of this post here.