feat(resume): add version stamping and bilingual EN/VN PDF support

- Add version stamp footer 'Last updated: YYYY-MM-DD' to PDF
- Implement bilingual support (English + Vietnamese) for resume PDF
  - Add Language type and *En optional fields to types
  - Add Vietnamese translations to profile, experience, projects data
  - resolveField utility for language-aware field resolution
  - Language-specific section labels (Experience/Kinh nghiệm, etc.)
  - --lang CLI arg: 'en' (default) or 'vi'
  - Output: resume.pdf (EN), resume-vi.pdf (VI)
- Update CI workflow to generate and deploy both PDF versions
- Add build:resume-all npm script
- Update UI components (Hero, DownloadResume) for language selection
- Add spec-v2-resume-future.md for deferred enhancements
- Refactor spec-v2-resume-playwright.md (condense implementation notes)
This commit is contained in:
dong.nguyen committed 2026-10-12 14:50:17 +07:00
1 parent 26af25a39d
commit 0297c18bad
15 files changed
+395 -301

No files matched your search

+42 -12
View File
@@ -1,21 +1,51 @@
import { resumeAvailable } from '@/data/resume'
import { resumeAvailable, resumeUrlFor, resumeLanguages } from '@/data/resume'
import type { Language } from '@/types'
const langLabels: Record<Language, string> = {
en: 'English',
vi: 'Tiếng Việt',
}
function DownloadButton({ lang }: { lang: Language }) {
return (
<a
href={resumeUrlFor(lang)}
download
className="contact-link"
style={{
display: 'flex',
alignItems: 'center',
gap: '12px',
padding: '12px 20px',
borderRadius: '8px',
textDecoration: 'none',
color: 'var(--text-primary)',
border: '1px solid var(--border)',
}}
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" width="24" height="24">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="7 10 12 15 17 10" />
<line x1="12" y1="15" x2="12" y2="3" />
</svg>
<div>
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>Download Resume</div>
<div style={{ fontSize: '14px', color: 'var(--text-muted)' }}>{langLabels[lang]}</div>
</div>
</a>
)
}
export function DownloadResume() {
if (!resumeAvailable) return null
return (
<div style={{ marginTop: '32px' }}>
<a href="/resume.pdf" download className="contact-link" style={{ display: 'flex', alignItems: 'center', gap: '12px', padding: '12px 20px', borderRadius: '8px', textDecoration: 'none', color: 'var(--text-primary)', border: '1px solid var(--border)' }}>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" width="24" height="24">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="7 10 12 15 17 10" />
<line x1="12" y1="15" x2="12" y2="3" />
</svg>
<div>
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>Download Resume</div>
<div style={{ fontSize: '14px', color: 'var(--text-muted)' }}>PDF</div>
</div>
</a>
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
{resumeLanguages.map(lang => (
<DownloadButton key={lang} lang={lang} />
))}
</div>
</div>
)
}
+8 -4
View File
@@ -1,6 +1,6 @@
import { motion, useScroll, useTransform } from "motion/react"
import { InView } from "@/components/ui/InView"
import { resumeAvailable } from "@/data/resume"
import { resumeAvailable, resumeLanguages, resumeUrlFor } from "@/data/resume"
import { Button } from "@/components/ui/Button"
import { SocialLinks } from "@/components/ui/SocialLinks"
import { profile } from "@/data/profile"
@@ -94,9 +94,13 @@ export function Hero() {
View Projects
</Button>
{resumeAvailable && (
<Button href="/resume.pdf" variant="secondary" target="_blank">
Download Resume
</Button>
<>
{resumeLanguages.map(lang => (
<Button key={lang} href={resumeUrlFor(lang)} variant="secondary" target="_blank">
Download Resume ({lang === 'en' ? 'EN' : 'VI'})
</Button>
))}
</>
)}
<Button href="/contact" variant="secondary">
Contact Me