blob: 7c4726eddc2fde262d7853ec85dae14677a6a365 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import { parsePost, type Post } from '$/lib/blog/Post.svelte'
const posts = import.meta.glob("./posts/*.svx") as Record<string, () => Promise<Post>>
const returnedData = Promise.all(Object.entries(posts).map(v => v[1]().then(r => [v[0], {
...parsePost(r as Post),
default: null,
}] as const)));
export const load = async () => {
return {
posts: Object.fromEntries(await returnedData)
}
}
|