This commit is contained in:
Vaica committed 2026-06-22 14:59:24 +08:00
1 parent ba7a2912e8
commit 3db86472fb
21 files changed
+921 -72

No files matched your search

+5 -1
View File
@@ -76,8 +76,9 @@ export function listPosts(options?: {
page?: number;
perPage?: number;
includeDrafts?: boolean;
author?: string;
}): { posts: PostListItem[]; total: number; totalPages: number } {
const { search = "", page = 1, perPage = ITEMS_PER_PAGE, includeDrafts = true } = options || {};
const { search = "", page = 1, perPage = ITEMS_PER_PAGE, includeDrafts = true, author } = options || {};
const dirs = findPostDirectories();
const allPosts: PostListItem[] = [];
@@ -102,6 +103,9 @@ export function listPosts(options?: {
if (!includeDrafts && post.draft) continue;
// 按作者过滤
if (author && post.author !== author) continue;
if (search) {
const q = search.toLowerCase();
const match =