format project
This commit is contained in:
parent
7651afaa0b
commit
a6d4064af8
83 changed files with 942 additions and 536 deletions
|
|
@ -4,14 +4,14 @@ import type { PageServerLoad } from './$types';
|
|||
import { getPosts } from '$lib/posts';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
try {
|
||||
const posts = await getPosts();
|
||||
try {
|
||||
const posts = await getPosts();
|
||||
|
||||
return {
|
||||
posts
|
||||
};
|
||||
} catch (err) {
|
||||
logger.error('Uh-oh!', err);
|
||||
error(500);
|
||||
}
|
||||
return {
|
||||
posts
|
||||
};
|
||||
} catch (err) {
|
||||
logger.error('Uh-oh!', err);
|
||||
error(500);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,15 +2,14 @@ import { error } from '@sveltejs/kit';
|
|||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
try {
|
||||
const post = await import(`../../../lib/posts/${params.slug}.md`);
|
||||
|
||||
try {
|
||||
const post = await import(`../../../lib/posts/${params.slug}.md`)
|
||||
|
||||
return {
|
||||
content: post.default,
|
||||
meta: post.metadata
|
||||
}
|
||||
} catch (e) {
|
||||
error(404, `Could not find ${params.slug}`)
|
||||
}
|
||||
return {
|
||||
content: post.default,
|
||||
meta: post.metadata
|
||||
};
|
||||
} catch (e) {
|
||||
error(404, `Could not find ${params.slug}`);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue