From 7f30e49a3e21797bcad9b8857631563c19d3ac79 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 07:11:52 +0000 Subject: [PATCH 1/2] Initial plan From 9bb056c28d3307cabe1c229d2483b95ef99c1935 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 07:27:42 +0000 Subject: [PATCH 2/2] Fix TypeScript error for blog page date property - Remove `as any` type casts from source.config.ts and source.ts - Properly configure fumadocs-mdx blog schema with extended frontmatter fields - Use z.coerce.string() for date field to handle YAML Date objects - Add BlogPostData interface and type assertions in blog page component - Build now passes successfully Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- .../docs/app/[lang]/blog/[[...slug]]/page.tsx | 124 ++++++++++-------- apps/docs/app/source.ts | 4 +- apps/docs/source.config.ts | 18 ++- 3 files changed, 82 insertions(+), 64 deletions(-) diff --git a/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx b/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx index bcea85046..1fd6d69eb 100644 --- a/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx @@ -6,6 +6,16 @@ import { baseOptions } from '@/app/layout.config'; import Link from 'next/link'; import { ArrowLeft } from 'lucide-react'; +// Extended type for blog post data +interface BlogPostData { + title: string; + description?: string; + author?: string; + date?: string; + tags?: string[]; + body: React.ComponentType; +} + export default async function BlogPage({ params, }: { @@ -28,52 +38,55 @@ export default async function BlogPage({
- {posts.map((post) => ( - -
-

- {post.data.title} -

- {post.data.description && ( -

- {post.data.description} -

- )} -
- -
- {post.data.date && ( - - )} - {post.data.author && ( - By {post.data.author} - )} -
- - {post.data.tags && post.data.tags.length > 0 && ( -
- {post.data.tags.map((tag: string) => ( - - {tag} - - ))} + {posts.map((post) => { + const postData = post.data as unknown as BlogPostData; + return ( + +
+

+ {postData.title} +

+ {postData.description && ( +

+ {postData.description} +

+ )} +
+ +
+ {postData.date && ( + + )} + {postData.author && ( + By {postData.author} + )}
- )} - - ))} + + {postData.tags && postData.tags.length > 0 && ( +
+ {postData.tags.map((tag: string) => ( + + {tag} + + ))} +
+ )} + + ); + })}
{posts.length === 0 && ( @@ -93,6 +106,7 @@ export default async function BlogPage({ notFound(); } + const pageData = page.data as unknown as BlogPostData; const MDX = page.data.body; return ( @@ -108,32 +122,32 @@ export default async function BlogPage({
-

{page.data.title}

+

{pageData.title}

- {page.data.description && ( + {pageData.description && (

- {page.data.description} + {pageData.description}

)}
- {page.data.date && ( -
- {page.data.tags && page.data.tags.length > 0 && ( + {pageData.tags && pageData.tags.length > 0 && (
- {page.data.tags.map((tag: string) => ( + {pageData.tags.map((tag: string) => (