diff --git a/src/routes/stats/[place]/+server.ts b/src/routes/stats/[place]/+server.ts index f7851c5..8375c3a 100644 --- a/src/routes/stats/[place]/+server.ts +++ b/src/routes/stats/[place]/+server.ts @@ -1,11 +1,14 @@ import { error, redirect } from '@sveltejs/kit'; -import { LEGACY, parsePlaces, statsHref } from '#lib/stats/matrix.js'; +import { LEGACY, THEME_BY_SLUG, parsePlaces, statsHref } from '#lib/stats/matrix.js'; import type { RequestHandler } from './$types'; // /stats/ → its overview; the old section URLs (/stats/economy, …) move permanently. export const GET: RequestHandler = ({ params, url }) => { const legacy = LEGACY[params.place.toLowerCase()]; if (legacy) redirect(301, `${legacy}${url.search}`); + // A bare theme (/stats/jobs) opens it for the default selection. + if (THEME_BY_SLUG.has(params.place.toLowerCase())) + redirect(307, `${statsHref('core', params.place.toLowerCase())}${url.search}`); const sel = parsePlaces(params.place); if (!sel) error(404, 'Not Found'); redirect(307, `${statsHref(sel.slug, 'overview')}${url.search}`);