From 97b7ba3c5516b9ece951b9560117a7aee79fbf97 Mon Sep 17 00:00:00 2001 From: Robert Wagner Date: Mon, 30 Nov 2026 09:48:35 -0500 Subject: [PATCH] Gather the palette's people only on prerendered pages The on-demand 404 rendered Layout, which awaited loadPeople() on every request: a feed fetch, a raw XML scan, image optimisation per person and database queries. Built pages still gather them; the 404's palette opens on episodes instead. Co-Authored-By: Claude Opus 5.5 --- packages/starpod/src/layouts/Layout.astro | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/starpod/src/layouts/Layout.astro b/packages/starpod/src/layouts/Layout.astro index b02ad659..0a6411df 100644 --- a/packages/starpod/src/layouts/Layout.astro +++ b/packages/starpod/src/layouts/Layout.astro @@ -34,11 +34,16 @@ import 'virtual:starpod/user-css'; const show = await getShowInfo(); // The palette's people: the explorer's With filter choices. The show's first // two hosts wear their transcript voices' colours, as on the About posters. +// Only built pages gather them: an on-demand page such as the 404 would fetch +// the feed and query the database on every request, so its palette starts +// with episodes instead. const hostNames = starpodConfig.hosts.map((host) => host.name); -const people = (await loadPeople()).map((person) => { - const voice = hostNames.indexOf(person.label); - return voice === 0 || voice === 1 ? { ...person, voice } : person; -}); +const people = Astro.isPrerendered + ? (await loadPeople()).map((person) => { + const voice = hostNames.indexOf(person.label); + return voice === 0 || voice === 1 ? { ...person, voice } : person; + }) + : []; export interface Props { /**