thomaswilson-sveltekit/src/lib/fetchBlogPosts.ts

8 lines
274 B
TypeScript
Raw Normal View History

2022-04-16 10:43:45 +00:00
import { getPostsFromGlobResult } from './getPostsFromGlobResult';
import type { Post } from './Post';
export const fetchBlogPosts = async (): Promise<Post[]> => {
const files = await import.meta.glob('../content/**/*.md');
return await getPostsFromGlobResult(files);
};