seo: per-route HTML + genuine 404, security headers, heading hierarchy (spec-v8)

Stage 1 (audit 4.1/4.2/4.4): scripts/generate-route-pages.ts (pnpm generate:routes, chained into build before the sitemap) rewrites the built head per route — title/description/canonical/og/twitter from the new ui/meta group (the six static manifests claim it) or from the project records — adds manifest-claimed <noscript> bodies and writes dist/404.html; nginx.conf resolves each URL against its generated file (try_files $uri/index.html $uri =404 + server-level error_page) so known routes answer 200 at the exact URL and unknown URLs a real 404; App.tsx adds the lazy catch-all route + src/pages/NotFoundPage.tsx for dead links inside the SPA (ui/common notFound keys, EN+VI); generate-sitemap.ts derives lastmod from the git history of the documents backing each URL and fails the build when a sitemap URL has no generated route file.

Stage 2 (audit 4.3/4.6): nginx.conf only — CSP (Report-Only, script-src carries the theme-init inline script hash, verified against the built bytes by the route generator), HSTS, nosniff, Referrer-Policy, Permissions-Policy, X-Frame-Options at server level and repeated in the two blocks that declare their own add_header; gzip_types for CSS/JS/JSON/SVG/XML with the hashed-asset immutable caching preserved.

Stage 3 (audit 4.7): SectionHeading gains level='h1'|'h2' and the six standalone pages render their top heading as h1; project detail blocks move h3->h2 and section titles h4->h3; diagram/code sections render in <pre class=project-diagram>, the Markdown fences are stripped from the two VI ASCII diagrams, the internal section-type chip renders only in edit mode; og:image declares the real 500x667.

docs: the 2026-10-29 site audit and spec-v8-seo-hardening (stages 1-3 repo-side DONE; owner browser walkthrough, CSP enforcement decision D5 and stage 4 D4 open).
This commit is contained in:
dong.nguyen committed 2026-11-02 13:02:53 +07:00
1 parent e02fe19bbe
commit 0dd2c6b3ee
32 files changed
+1181 -47

No files matched your search

+2 -1
View File
@@ -6,9 +6,10 @@
"scripts": {
"dev": "vite",
"predev": "pnpm generate:ids",
"build": "tsc -b && vite build && pnpm tsx scripts/generate-sitemap.ts",
"build": "tsc -b && vite build && pnpm tsx scripts/generate-route-pages.ts && pnpm tsx scripts/generate-sitemap.ts",
"prebuild": "pnpm generate:ids",
"generate:ids": "pnpm tsx scripts/generate-content-types.ts",
"generate:routes": "pnpm tsx scripts/generate-route-pages.ts",
"prepare": "pnpm generate:ids",
"build:resume": "pnpm tsx scripts/generate-resume.ts",
"build:resume-all": "pnpm tsx scripts/generate-resume.ts --lang=all",