2023-01-31 19:27:36 +01:00
|
|
|
import type { LayoutLoad } from './$types'
|
2023-01-17 20:57:28 +01:00
|
|
|
|
2023-01-31 19:27:36 +01:00
|
|
|
export const load = (async ({ fetch }) => {
|
|
|
|
const blogPostsResponse = await fetch(`/blog/articles/pageSize/5`)
|
2023-01-17 20:57:28 +01:00
|
|
|
const blogPostsContent = await blogPostsResponse.json()
|
|
|
|
|
|
|
|
return {
|
|
|
|
latestPosts: blogPostsContent.posts.items,
|
|
|
|
}
|
|
|
|
}) satisfies LayoutLoad
|