Initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { getPageBySlug } from '$lib/server/content';
|
||||
|
||||
export async function load({ params }) {
|
||||
const page = await getPageBySlug(params.slug);
|
||||
|
||||
if (!page || page.slug === 'home') {
|
||||
throw error(404, 'Page not found.');
|
||||
}
|
||||
|
||||
return { page };
|
||||
}
|
||||
Reference in New Issue
Block a user