Skip to content

feat: add technology blog page#3

Merged
tsurumi-yizhou merged 3 commits intomainfrom
tech-blog
Apr 8, 2026
Merged

feat: add technology blog page#3
tsurumi-yizhou merged 3 commits intomainfrom
tech-blog

Conversation

@tsurumi-yizhou
Copy link
Copy Markdown
Member

@tsurumi-yizhou tsurumi-yizhou commented Apr 8, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Launched a new dedicated blog section with featured article spotlights and browsable post listings
    • Added support for both English and Chinese blog content
    • Updated navigation menu to provide direct access to the blog section
    • Introduced featured and standard article card layouts for improved content discovery

Copilot AI review requested due to automatic review settings April 8, 2026 12:04
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Build & Navigation Configuration
.gitignore, .vitepress/config.mts
Updated .vitepress temp directory rule and updated navbar entries in both English and Chinese locales to point to /blog/ instead of homepage.
Blog Component Utilities
.vitepress/theme/components/blogCardProps.ts
Added three helper functions for text prop validation: isNonEmptyString(), createRequiredTextProp(), and assertRequiredTextProps() to enforce required, non-empty string props across blog components.
Blog Vue Components
.vitepress/theme/components/BlogShell.vue, BlogFeaturedCard.vue, BlogPostCard.vue, .vitepress/theme/index.ts
Added three new blog components (BlogShell for layout, BlogFeaturedCard and BlogPostCard for content cards) with required typed props and dev-time validation; registered them globally via theme's enhanceApp hook.
Blog Index Pages
en/blog/index.md, zh/blog/index.md
Added localized blog index pages that use BlogShell container with featured and regular post cards, displaying metadata (date, author), content (title, summary), and CTAs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A blog hops into view,
With cards of featured and new,
Props validated true,
In English and Chinese too,
The warren celebrates what's grew! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add technology blog page' directly and clearly describes the main changes: new blog page components, layouts, and index pages in both English and Chinese locales.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tech-blog

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, BlogPostCard components (+ 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.

Comment on lines +2 to +11
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) {
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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)) {

Copilot uses AI. Check for mistakes.
@tsurumi-yizhou tsurumi-yizhou merged commit 3ccf912 into main Apr 8, 2026
5 of 6 checks passed
@tsurumi-yizhou tsurumi-yizhou deleted the tech-blog branch April 9, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants