It wasn’t in the script.

Okay, my archive links now work properly. I’d been missing a “</script>” line in my archive template. Bizarre.