Files
dong.nguyen e6dc99ec85 docs(specs): record the review-fix spec, gate results and doc-drift closure
New spec-v3-review-fixes.md carries the findings, the per-bundle implementation detail, the affected-file list, the out-of-scope table including the declined resume.pdf bundle with its measured 200 text/html probe, the gate numbers and the commit record. spec-v2-seo.md acceptance is now honest: robots, sitemap, JSON-LD and canonical are done, per-route title/description/OG remain open because the SPA serves one head for every route. spec-v2.md statuses no longer contradict shipped work. AGENTS.md drops both barrels, documents the pure field() helper, the canonical origin module, the sitemap build step and the lazy/default-export gotcha.
2026-10-18 23:46:39 +07:00

75 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Specification — v2 SEO
> **Document:** `spec-v2-seo.md`
> **Version:** 0.1.0
> **Parent:** `spec-v2.md`
> **Priority:** P1
> **Estimate:** ~1 hour
---
## Requirement
Mỗi page có metadata riêng cho SEO và social sharing.
---
## Implementation
### Dynamic Metadata
Dùng `react-helmet-async`.
```tsx
import { Helmet } from 'react-helmet-async'
// HomePage.tsx
<Helmet>
<title>{profile.name} — Senior Software Engineer</title>
<meta name="description" content={profile.bio} />
<link rel="canonical" href={siteUrl} />
</Helmet>
```
### Open Graph
Mỗi page có OG tags:
```html
<meta property="og:title" content="..." />
<meta property="og:description" content="..." />
<meta property="og:image" content="/og-image.png" />
<meta property="og:url" content="..." />
<meta property="og:type" content="website" />
```
### Sitemap
- Generate `sitemap.xml` tại build time
- Dùng `vite-plugin-sitemap` hoặc tự viết script
- Include tất cả public pages
### Robots.txt
- `public/robots.txt`
- Allow all
### Structured Data (JSON-LD)
- `Person` schema cho homepage
- `Article` schema cho blog posts (sau này)
- `BreadcrumbList` cho nested pages
---
## Acceptance
- [~] Homepage `<title>` + `<meta description>` are real (Bundle D of `specs/v3/spec-v3-review-fixes.md`). Per-route titles/descriptions are still open: the SPA serves one head for every route, so `/about` and `/projects/{id}` report the homepage metadata. Closing this needs head management in React or build-time prerender
- [~] OG tags are correct for the homepage URL, including `og:image` with explicit 1200×1600 and alt text. Per-page `og:title` / `og:url` are not emitted, for the same reason
- [x] `sitemap.xml` generated at build — `scripts/generate-sitemap.ts`, chained into `pnpm build`, 10 urls (6 `navPaths` + 4 `/projects/{id}`), each with `lastmod`
- [x] `robots.txt` in `public/` — allow-all plus the `Sitemap:` pointer to the canonical origin
- [x] JSON-LD structured data — `Person` on the homepage with `sameAs` GitHub/LinkedIn and a `PostalAddress`. `BreadcrumbList` and the blog `Article` schema remain open
- [x] Canonical URL correct — `https://cv.vugado.com/` in `index.html`; `src/data/site.ts` is the single source the sitemap derives from, and the generator fails the build if `dist/index.html` no longer contains it
Measurements and HTTP probes: `specs/v3/spec-v3-review-fixes.md` §5.1.