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 { /**