Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
|
@copilot 继续 |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Completed! The blog section has been successfully added using Fumadocs. What's been implemented:
The implementation is live and working. You can now access the blog at Latest commit: dee0344 Screenshots: |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot 帮我写两篇深度的分析文章,更新博客现有的内容 |
…en architecture and protocol-first development Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
已完成!我已经创建了两篇深度分析文章来更新博客内容: 文章 1: "The Architecture of Metadata-Driven Systems: From Salesforce to ObjectStack" (17,000+ 字)
文章 2: "Protocol-First Development: Why ObjectStack Chose Open Standards Over Proprietary Platforms" (23,000+ 字)
两篇文章都包含:
Latest commit: 5967a13 截图: |
|
This PR is very large. Consider breaking it into smaller PRs for easier review. |
- 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>
|
This PR is very large. Consider breaking it into smaller PRs for easier review. |
There was a problem hiding this comment.
Pull request overview
This pull request improves the homepage readability by fixing font color contrast issues and adds a comprehensive blog section using fumadocs. The changes include configuration updates, new blog routing, and two in-depth analytical articles about ObjectStack's architecture and protocol-first philosophy.
Changes:
- Fixed homepage font colors from
text-fd-muted-foregroundtotext-fd-foreground/80and/70variants for better readability in light mode - Configured fumadocs blog collection with custom schema for author, date, and tags
- Added blog navigation link and implemented blog index and individual post pages
- Created two comprehensive technical articles (17,000+ and 23,000+ words) analyzing metadata-driven architecture and protocol-first development
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/docs/source.config.ts | Added blog collection configuration with custom schema for metadata |
| apps/docs/app/source.ts | Exported blog loader alongside docs loader |
| apps/docs/app/layout.config.tsx | Added "Blog" navigation link |
| apps/docs/app/[lang]/page.tsx | Updated text colors for hero subtitle, features, and personas for better contrast |
| apps/docs/app/[lang]/blog/[[...slug]]/page.tsx | Created blog pages with index and individual post rendering |
| content/blog/protocol-first-development.mdx | Added comprehensive article on protocol-first development philosophy |
| content/blog/metadata-driven-architecture.mdx | Added in-depth analysis of metadata-driven architecture patterns |
| export async function generateMetadata({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ slug?: string[] }>; |
There was a problem hiding this comment.
The generateMetadata function's params type is missing the lang parameter that exists in the route. The type should be params: Promise<{ lang: string; slug?: string[] }> to match the route structure and the main component's params type.
|
|
||
| // Use explain() to check query plan | ||
| const plan = await this.db.collection(object).explain(); | ||
| if (!plan.executionStats.totalDocsExamined < plan.executionStats.nReturned * 10) { |
There was a problem hiding this comment.
The conditional logic is incorrect. The expression !plan.executionStats.totalDocsExamined < plan.executionStats.nReturned * 10 will always evaluate incorrectly due to operator precedence. The ! operator has higher precedence than <, so it evaluates as (!plan.executionStats.totalDocsExamined) < ... which is not the intended logic. It should be !(plan.executionStats.totalDocsExamined < plan.executionStats.nReturned * 10) or better yet plan.executionStats.totalDocsExamined >= plan.executionStats.nReturned * 10.
| if (!plan.executionStats.totalDocsExamined < plan.executionStats.nReturned * 10) { | |
| if (plan.executionStats.totalDocsExamined >= plan.executionStats.nReturned * 10) { |
|
|
||
| const blogSchema = frontmatterSchema.extend({ | ||
| author: z.string().optional(), | ||
| date: z.coerce.string().optional(), |
There was a problem hiding this comment.
The date schema uses z.coerce.string() which is redundant. Since the frontmatter dates are already in string format (e.g., "2024-01-20"), you should use z.string() directly. The .coerce is unnecessary and can cause unexpected behavior when the date is already a string.
| date: z.coerce.string().optional(), | |
| date: z.string().optional(), |
| }: { | ||
| params: Promise<{ lang: string; slug?: string[] }>; | ||
| }) { | ||
| const { slug } = await params; |
There was a problem hiding this comment.
The lang parameter is extracted from params but never used in the BlogPage component. The component should either use this parameter for internationalization or remove it from the destructuring if it's not needed. Consider whether blog posts should support multiple languages.
| export async function generateStaticParams() { | ||
| return blog.getPages().map((page) => ({ | ||
| slug: page.slugs, | ||
| })); |
There was a problem hiding this comment.
The generateStaticParams function is missing the lang parameter that should be included in the returned objects since the route includes [lang] as a dynamic segment. This could cause build errors or missing routes for different languages.



Implementation Plan
text-fd-muted-foregroundtotext-fd-foreground/80text-fd-muted-foregroundtotext-fd-foreground/70text-fd-muted-foregroundtotext-fd-foreground/70Changes Made
1. Homepage Font Color Improvements
Fixed text contrast issues to improve readability in light mode:
text-fd-muted-foreground→text-fd-foreground/80text-fd-muted-foreground→text-fd-foreground/70text-fd-muted-foreground→text-fd-foreground/702. Blog Section Implementation
Successfully integrated Fumadocs blog functionality:
Configuration:
source.config.tsto define blog collection with custom schema (author, date, tags)app/source.tsto export blog loaderlayout.config.tsxz.string().or(z.date())→z.string().date()Pages:
/app/[lang]/blog/[[...slug]]/page.tsxfor both blog index and individual postsContent:
Created
/content/blog/directory with 2 comprehensive analytical articles:Article 1: "The Architecture of Metadata-Driven Systems: From Salesforce to ObjectStack" (17,000+ words)
A comprehensive analysis covering:
Article 2: "Protocol-First Development: Why ObjectStack Chose Open Standards Over Proprietary Platforms" (23,000+ words)
An in-depth exploration covering:
Features:
Screenshots
Homepage - Before Font Fix
Homepage - After Font Fix (with Blog Link)
Blog Index Page - Updated with In-Depth Articles
Individual Blog Post
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.