mirror of
https://github.com/ProjectSegfault/website.git
synced 2024-06-17 18:22:07 +05:30
14 lines
321 B
TypeScript
14 lines
321 B
TypeScript
import type { PageServerLoad } from "./$types";
|
|
import fetchApi from "$lib/ghost";
|
|
|
|
export const load = (async ({ params }) => {
|
|
const data = await fetchApi("posts/slug/" + params.title);
|
|
|
|
const allPosts = await fetchApi("posts");
|
|
|
|
return {
|
|
post: data.posts[0],
|
|
allPosts: allPosts
|
|
};
|
|
}) satisfies PageServerLoad;
|