refactor: update fetch method and frontmatter type

This commit is contained in:
satnaing
2023-01-26 22:56:02 +06:30
parent 7c1de46462
commit 293bad3b49
+3 -2
View File
@@ -3,9 +3,10 @@ import { SITE } from "src/config";
import Posts from "@layouts/Posts.astro"; import Posts from "@layouts/Posts.astro";
import getSortedPosts from "@utils/getSortedPosts"; import getSortedPosts from "@utils/getSortedPosts";
import getPageNumbers from "@utils/getPageNumbers"; import getPageNumbers from "@utils/getPageNumbers";
import type { Frontmatter } from "src/types";
const posts = await Astro.glob<Frontmatter>("../../contents/**/*.md"); import { getCollection } from "astro:content";
const posts = await getCollection("blog");
const sortedPosts = getSortedPosts(posts); const sortedPosts = getSortedPosts(posts);