feat: 新增置顶文章

This commit is contained in:
KazooTTT
2025-02-14 18:59:28 +08:00
parent c7b012a891
commit 3af73ab320
5 changed files with 40 additions and 2 deletions

View File

@ -8,6 +8,12 @@ export async function getAllPosts(): Promise<CollectionEntry<"post">[]> {
});
}
export async function getAllFixedToTopPosts(): Promise<CollectionEntry<"post">[]> {
return await getCollection("post", ({ data }) => {
return import.meta.env.PROD ? data.fixedToTop : false;
});
}
export async function getAllCollectionPosts() {
const posts = await getAllPosts();
const notes = await getCollection("note");