Skip to content

feat(site): rework the site, and add sign-ups, privacy and link previews - #4

Merged
aicayzer merged 8 commits into
mainfrom
feat/rework-header-copy
Oct 21, 2026
Merged

aicayzer merged 8 commits into
mainfrom
feat/rework-header-copy

Conversation

@aicayzer

Copy link
Copy Markdown
Contributor

Reworks withmarfa.com after review, and adds a way to sign up for updates.

What changes for a visitor

  • Header: the Marfa mark (top left, leads home), a GitHub icon and the Docs pill, the same on every page.
  • Footer: About, Contact and Privacy. Contact opens a small card that shows hello@withmarfa.com with Copy address and Open Mail, so nothing opens a mail app unannounced.
  • Home: a shorter intro and three new questions (try it, iCloud, cost). One question opens at a time (<details name>).
  • About: a rewritten story, What's next in four steps, and Follow along, a sign-up form.
  • Privacy: a short page on what the site collects: cookieless page views in PostHog (IP addresses discarded) and sign-up addresses in D1.
  • Type and spacing: one size smaller, about 70 characters per line, and more space between sections.
  • Search and sharing: clearer titles and descriptions, a 1200×630 preview image, twitter:card, a sitemap listed in robots.txt, WebSite structured data on home, and noindex on the 404 and thank-you pages.

Sign-ups

  • worker/index.ts answers POST /api/subscribe; run_worker_first: ["/api/*"] keeps every page a static asset.
  • It requires the site's own Origin, limits each IP address to five tries a minute (Workers rate limiting), caps the body at 2 KB, ignores a filled honeypot field, and validates the address loosely.
  • It stores the lowercased address and time in the signups table of D1 withmarfa-website (EU jurisdiction; migration applied). Repeat addresses return the same reply, and no address is logged.
  • With JavaScript the form shows the result in place; without it the Worker redirects with 303 to /subscribed, or back to the form.
  • Observability (logs and traces) is on.

Fixes found on the way

  • Astro 7's default compressHTML: 'jsx' dropped the space before a link that started a new source line ("TheAbout page"). It is now true, which is lossless.
  • Astro inlined small component scripts, which the Content Security Policy blocks. vite.build.assetsInlineLimit: 0 keeps every script a file.

Testing

  • pnpm check (Astro, wrangler types --check, tsc -p worker) and pnpm build pass.
  • Against wrangler dev with a local D1: a valid address (trimmed and lowercased), a duplicate, an invalid address, the honeypot, URL-encoded and multipart bodies, no Origin, a foreign Origin, GET, an unknown /api path, an oversized body, the no-JavaScript redirect, and the rate limit after five tries. Only valid addresses were stored, once each.
  • In the browser: the form in place (an invalid then a valid address), the Contact card, and one question open at a time. Checked at 1440×820 and 393×720, light and dark, with no horizontal scroll; home fits one screen at both sizes.
  • wrangler versions upload with the CI deploy token succeeded, so the token can deploy the D1 and rate-limit bindings. That version was not deployed.

@aicayzer

Copy link
Copy Markdown
Contributor Author

Review: the reviewer found that Cloudflare's invocation logs and traces would keep each visitor's location and browser beside the time of their sign-up, which the privacy page did not cover; they are now off, and only the Worker's own log lines, which never hold an address, are kept. It also fixed the privacy page's description of page views (PostHog does no location lookup in cookieless mode) and made About name Marfa, not Marfa Cloud, as what is free. A visitor without JavaScript whose sign-up fails now lands on /subscribe-failed instead of an unchanged form, and the page-path normalisation lives in one helper.

@aicayzer
aicayzer merged commit 1eb4791 into main Oct 21, 2026
2 checks passed
@aicayzer
aicayzer deleted the feat/rework-header-copy branch October 21, 2026 11:33
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