Conversation
Agent-Logs-Url: https://github.com/clice-io/docs/sessions/a782f4f1-5379-4b86-9f5e-f229a1700657 Co-authored-by: tsurumi-yizhou <89072149+tsurumi-yizhou@users.noreply.github.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a blog feature to VitePress by adding three reusable blog components with prop validation utilities, updates navigation entries to highlight the blog section, and provides localized blog index pages for English and Chinese audiences. Configuration files are also updated accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new “Blog” landing page to the VitePress site (English + Chinese) backed by custom theme components, and exposes it via top-level navigation.
Changes:
- Added
/blog/and/zh/blog/index pages rendering featured + list-style post cards. - Introduced
BlogShell,BlogFeaturedCard,BlogPostCardcomponents (+ shared prop helpers) and registered them globally in the theme. - Updated locale nav to point to the new blog pages and adjusted the ignored VitePress temp directory path.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
zh/blog/index.md |
New Chinese blog index page using the new blog components. |
en/blog/index.md |
New English blog index page using the new blog components. |
.vitepress/theme/index.ts |
Registers blog components globally via enhanceApp. |
.vitepress/theme/components/BlogShell.vue |
Adds the blog page shell layout and header. |
.vitepress/theme/components/BlogPostCard.vue |
Adds a reusable post card component. |
.vitepress/theme/components/BlogFeaturedCard.vue |
Adds a featured post card component. |
.vitepress/theme/components/blogCardProps.ts |
Adds shared “required non-empty string” prop helpers/assertions. |
.vitepress/config.mts |
Updates locale nav to link to /blog/ and /zh/blog/. |
.gitignore |
Updates ignored VitePress temp directory to .vitepress/.temp. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const props = defineProps({ | ||
| title: { | ||
| type: String, | ||
| required: true, | ||
| validator: (value: string) => value.trim().length > 0, | ||
| }, | ||
| }) | ||
|
|
||
| if (import.meta.env.DEV) { | ||
| if (!props.title || props.title.trim().length === 0) { |
There was a problem hiding this comment.
validator: (value: string) => value.trim().length > 0 assumes the validator will always receive a string. Vue can still invoke the validator with non-string values (e.g., when a consumer passes the wrong type), which would throw at runtime on trim(). Consider reusing the existing isNonEmptyString/createRequiredTextProp() helper from blogCardProps.ts for title (and you can then drop the redundant DEV-only manual check).
| const props = defineProps({ | |
| title: { | |
| type: String, | |
| required: true, | |
| validator: (value: string) => value.trim().length > 0, | |
| }, | |
| }) | |
| if (import.meta.env.DEV) { | |
| if (!props.title || props.title.trim().length === 0) { | |
| const isNonEmptyString = (value: unknown): value is string => | |
| typeof value === 'string' && value.trim().length > 0 | |
| const props = defineProps({ | |
| title: { | |
| type: String, | |
| required: true, | |
| validator: (value: unknown) => isNonEmptyString(value), | |
| }, | |
| }) | |
| if (import.meta.env.DEV) { | |
| if (!isNonEmptyString(props.title)) { |
Summary by CodeRabbit
Release Notes