Files
gw-svelte/src/routes/locations/[suburb]/+page.server.ts
T

18 lines
456 B
TypeScript

import { error } from '@sveltejs/kit';
import { locationsBySlug } from '$lib/content/locations';
import { getSharedPageContent } from '$lib/server/content';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ params }) => {
const location = locationsBySlug[params.suburb];
if (!location) {
throw error(404, 'Page not found');
}
return {
content: await getSharedPageContent(),
location
};
}