mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-23 00:20:40 +07:00
- Add resume download button in Hero CTA and Contact section - Migrate react-router v6→v7 and v7→v8 - Restructure specs: UI specs to specs/ui/, v2 specs to specs/v2/ - Add profile-photo assets (jpg + webp) - Update AGENTS.md, spec-v2.md index
2.0 KiB
2.0 KiB
Specification — v2 Blog System
Document:
spec-v2-blog.mdVersion: 0.1.0 Parent:spec-v2.mdPriority: P1 Estimate: ~4 hours
Requirement
Blog cho phép viết technical articles bằng Markdown/MDX, render trên client.
Architecture
src/
content/
blog/
post-1.mdx
post-2.mdx
components/
blog/
BlogListPage.tsx
BlogPostPage.tsx
ArticleCard.tsx
CodeBlock.tsx
Features
Frontmatter
Mỗi article có frontmatter:
---
title: "Building High-Performance Event Simulation with Go"
date: "2024-06-15"
tags: ["engineering", "golang", "simulation"]
summary: "Discrete event simulation for logistics facilities"
---
Blog List Page (/blog)
- Hiển thị danh sách articles
- Sort theo date (newest first)
- Filter theo tags (pill buttons)
- Mỗi article card: title, date, tags, summary
Article Page (/blog/:slug)
- Render MDX content
- Code blocks với syntax highlighting
- TOC (table of contents) sidebar (desktop)
- Reading time estimate
- Breadcrumb navigation
Code Highlighting
- Dùng
rehype-prism-plushoặcrehype-raw+prismjs - Không dùng library nặng như
react-syntax-highlighter - Theme: dark/light compatible với CSS variables
MDX Processing
- Dùng
@mdx-js/react+@mdx-js/rollup(Vite plugin) - Build-time compilation (không runtime)
- Frontmatter extracted tại build time
Vite Config Changes
import mdx from '@mdx-js/rollup'
export default defineConfig({
plugins: [
react(),
mdx({
providerImportSource: '@mdx-js/react',
}),
],
})
Acceptance
/bloghiển thị danh sách articles- Article card có title, date, tags, summary
- Click article → navigate đến
/blog/:slug - MDX content render đúng
- Code blocks có syntax highlighting
- Tags filter hoạt động
- TOC sidebar (desktop only)
- Reading time hiển thị
- Responsive
- Không crash khi missing article