Skip to content

Commit a597b45

Browse files
committed
修复博客文章查找逻辑并更新文件匹配模式
1 parent dffa31e commit a597b45

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

apps/site/app/blog/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async function BlogPost({
1010
params: Promise<{ slug: string }>;
1111
}) {
1212
const { slug } = await params;
13-
const post = blog.find((post: any) => post.slug === slug);
13+
const post = blog.find((post: any) => post.slug === slug) as any;
1414

1515
if (!post) notFound();
1616

apps/site/source.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const { docs, meta } = defineDocs({
99

1010
export const blog = defineCollections({
1111
dir: 'content/blog',
12+
files: ['**/*.{md,mdx}', '!**/node_modules/**'],
1213
schema: z.object({
1314
title: z.string(),
1415
description: z.string().optional(),

0 commit comments

Comments
 (0)