mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
feat: resume download, router v7/v8 migrations, spec restructure
- 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
This commit is contained in:
1 parent
02bad6036d
commit
d827bf9b23
37 files changed
+770
-443
No files matched your search
@@ -0,0 +1,105 @@
|
||||
# Specification — v2 Blog System
|
||||
|
||||
> **Document:** `spec-v2-blog.md`
|
||||
> **Version:** 0.1.0
|
||||
> **Parent:** `spec-v2.md`
|
||||
> **Priority:** 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:
|
||||
|
||||
```yaml
|
||||
---
|
||||
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-plus` hoặc `rehype-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
|
||||
|
||||
```ts
|
||||
import mdx from '@mdx-js/rollup'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
mdx({
|
||||
providerImportSource: '@mdx-js/react',
|
||||
}),
|
||||
],
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Acceptance
|
||||
|
||||
- [ ] `/blog` hiể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
|
||||
Reference in new issue
Block a user