Skip to content

feat(seo): envcompare.vercel.app, social preview card, and discovery metadata - #2

Merged
imgul merged 1 commit into
mainfrom
arena/146e4b39-env-compare
Oct 20, 2026
Merged

imgul merged 1 commit into
mainfrom
arena/146e4b39-env-compare

Conversation

@imgul

@imgul imgul commented Oct 20, 2026

Copy link
Copy Markdown
Member

What

Makes the site findable and shareable, and puts it on the name people will actually type.

Domain — envcompare.vercel.app is now attached to the project and serving production. (First choice, taken; env-compare.vercel.app belongs to someone else. The old env-compare-six.vercel.app alias still resolves.)

Preview card — public/og-image.png, 1200×630, 366 kB: dark surface, one headline, one supporting line, and the state vocabulary (Match · Missing · Same · Different · Extra) doing the explaining. Checked at full size so the text is legible at thumbnail size — the most common way an OG card fails. Touch icon (180 px) and manifest icons (192/512) are redrawn from the favicon geometry, so the mark is identical everywhere.

Metadata — description at 155 chars, canonical, robots: index, follow, max-image-preview:large, the full og:* set (type, site_name, url, title, description, image, image:type/width/height/alt, locale), twitter:summary_large_image, and one WebApplication JSON-LD block. Every URL is absolute on the canonical host, so a preview never depends on where the reader opened it. robots.txt, sitemap.xml (exactly the three routes vercel.json rewrites) and site.webmanifest ship as static files with long-lived cache headers.

The guard change, and why it is not a loosening

The privacy guard correctly failed the build twice: once for the JSON-LD block ("inline <script>") and once for the canonical link ("loads an external resource"). Both rules exist for good reasons, so they are narrowed rather than dropped:

  • JSON-LD blocks are stripped before the inline-script check, but each one must now parse as JSON — a block that is not JSON is treated as smuggled code.
  • Only rel="canonical" is excused from the external-<link> rule, because metadata is not a request.

Verified with three deliberate violations, each of which still fails the build: a real inline alert(1) script, a Google Fonts stylesheet, and a JSON-LD block containing fetch().

Tests

tests/unit/metadata.test.ts — 13 tests: tag values, title ≤ 60 and description in the 120–165 band, absolute https:// URLs, JSON-LD parses and describes a free WebApplication, the card is actually 1200×630 and under 1 MB, every declared icon size matches its file, robots.txt and sitemap.xml agree with the rewrite list, and the CSP is untouched.

npx tsc · 378 tests / 19 files · npm run build · npm run privacy — all green.

Preview

OG card

- public/og-image.png: 1200x630 card in the product's own vocabulary, plus
  matching touch/manifest icons drawn from the favicon geometry.
- index.html: canonical URL, 155-char description, full Open Graph set with
  real image dimensions and alt text, summary_large_image Twitter card, and a
  single WebApplication JSON-LD block. All URLs absolute on the canonical host.
- robots.txt, sitemap.xml (only the rewrites), site.webmanifest, and long-lived
  cache headers for static assets in vercel.json.
- The privacy guard now permits one inert JSON-LD block, but requires it to
  parse as JSON, and excuses only rel=canonical from the external-link rule.
  Verified against three deliberate violations.
- tests/unit/metadata.test.ts (13 tests) checks tag values, lengths, absolute
  URLs, real pixel sizes, and that the sitemap cannot drift from the rewrites.

378 tests, typecheck, build and privacy guard green.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@imgul
imgul merged commit 23c8d97 into main Oct 20, 2026
1 of 2 checks passed
imgul added a commit that referenced this pull request Oct 20, 2026
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
imgul added a commit that referenced this pull request Oct 20, 2026
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
imgul added a commit that referenced this pull request Oct 20, 2026
feat(seo): envcompare.vercel.app, social preview card, and discovery metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant