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