Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { error, redirect } from '@sveltejs/kit';
|
||||
import { staticPages, type StaticPageSlug } from '$lib/content/static-pages';
|
||||
import { getSharedPageContent } from '$lib/server/content';
|
||||
|
||||
export async function load({ params }) {
|
||||
if (params.slug === 'about-us') {
|
||||
throw redirect(301, '/about');
|
||||
}
|
||||
|
||||
const slug = params.slug as StaticPageSlug;
|
||||
const page = staticPages[slug];
|
||||
|
||||
if (!page) {
|
||||
throw error(404, 'Page not found');
|
||||
}
|
||||
|
||||
return {
|
||||
content: await getSharedPageContent(),
|
||||
page,
|
||||
slug
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user