|
| 1 | +# Astro Migration Parity Contract |
| 2 | + |
| 3 | +This document defines the "must match" behaviors and routes to keep the Astro |
| 4 | +migration safe and low-risk. Changes outside this list are deferred until after |
| 5 | +cutover. |
| 6 | + |
| 7 | +## Must Match |
| 8 | + |
| 9 | +### Routes (trailing slash preserved) |
| 10 | +- `/` (home) |
| 11 | +- `/about/` |
| 12 | +- `/faq/` |
| 13 | +- `/projects/` |
| 14 | +- `/projects/gazette-protocol/` (draft content; see Draft Handling) |
| 15 | +- `/projects/the-truth-post/` |
| 16 | +- `/projects/prove-me-wrong/` (draft content; see Draft Handling) |
| 17 | +- `/404/` (404 page) |
| 18 | + |
| 19 | +### Markdown Source + Frontmatter |
| 20 | +Source files live in `src/pages/**/*.md` with frontmatter: |
| 21 | +- `slug` (string, required) |
| 22 | +- `draft` (boolean, optional) |
| 23 | +- `toc` (boolean, optional) |
| 24 | + |
| 25 | +### Draft Handling |
| 26 | +Current Gatsby behavior hides drafts in all environments because `process.env.ENV` |
| 27 | +is undefined. For parity-first, drafts should remain hidden in production and |
| 28 | +preview unless we explicitly opt-in to show them. |
| 29 | + |
| 30 | +### TOC Behavior |
| 31 | +If `toc: true`, insert a list of `h2` headings immediately after the first `h1`. |
| 32 | +Each entry links to the heading id (slugged). |
| 33 | + |
| 34 | +### SEO + Metadata |
| 35 | +- Canonical/OG/Twitter tags match the current `Seo` component. |
| 36 | +- `og:url` and canonical should use the deployment base URL. |
| 37 | + - Production base: `https://proveuswrong.io/` |
| 38 | + - Preview base: `CF_PAGES_URL` (Cloudflare Pages) |
| 39 | +- `og:image` defaults to the site icon (`src/images/icon.png`). |
| 40 | + |
| 41 | +### Sitemap/Robots |
| 42 | +- `sitemap.xml` available at `/sitemap.xml` |
| 43 | +- `robots.txt` allows all (`User-agent: *`, `Allow: /`) |
| 44 | + |
| 45 | +### Assets + Paths |
| 46 | +- Static files in `static/` are served from the site root: |
| 47 | + - `/pressKit.zip` |
| 48 | + - `/link.svg` |
| 49 | + - `/linkRed.svg` |
| 50 | +- Image assets in `src/images/` are used by layout and About page. |
| 51 | + |
| 52 | +### Styling |
| 53 | +- SCSS modules and global styles must retain current visual output. |
| 54 | + |
| 55 | +## Open Decisions (post-parity) |
| 56 | +- PWA manifest/offline support (currently in Gatsby, can be reintroduced later). |
| 57 | +- Whether drafts should be visible in preview builds. |
| 58 | +- Whether to keep React components or rewrite to native Astro. |
| 59 | + |
| 60 | +## Parity Check Results (Astro build) |
| 61 | +- Routes rendered in `astro/dist`: `/`, `/about/`, `/faq/`, `/projects/`, `/projects/the-truth-post/`, `/404/`. |
| 62 | +- Draft routes excluded from build output as expected (`/projects/gazette-protocol/`, `/projects/prove-me-wrong/`). |
| 63 | +- TOC insertion verified on `/faq/` (list of `h2` links placed after first `h1`). |
| 64 | +- SEO tags present on sampled pages (title, description, OG/Twitter, `og:url` uses `https://proveuswrong.io/`). |
| 65 | +- Static assets verified in output root and `/images/` (press kit + icons + portraits). |
| 66 | +- `sitemap.xml` now served as an index pointing to `/sitemap-0.xml` (fixes robots.txt parity). |
0 commit comments