From 293bad3b499912d2576e167e552bed00e43bfce8 Mon Sep 17 00:00:00 2001 From: satnaing Date: Thu, 26 Jan 2023 22:56:02 +0630 Subject: [PATCH] refactor: update fetch method and frontmatter type --- src/pages/posts/index.astro | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/posts/index.astro b/src/pages/posts/index.astro index e46eaa0..7bd7a8f 100644 --- a/src/pages/posts/index.astro +++ b/src/pages/posts/index.astro @@ -3,9 +3,10 @@ import { SITE } from "src/config"; import Posts from "@layouts/Posts.astro"; import getSortedPosts from "@utils/getSortedPosts"; import getPageNumbers from "@utils/getPageNumbers"; -import type { Frontmatter } from "src/types"; -const posts = await Astro.glob("../../contents/**/*.md"); +import { getCollection } from "astro:content"; + +const posts = await getCollection("blog"); const sortedPosts = getSortedPosts(posts);