Skip to content

New website: Next.js, Fumadocs, Payload - #344

Merged
TeoSlayer merged 1 commit into
mainfrom
website-redesign
Nov 16, 2026
Merged

TeoSlayer merged 1 commit into
mainfrom
website-redesign

Conversation

@enter-agent

@enter-agent enter-agent commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

Replaces the Astro site with the redesigned site: Next.js 16 on Cloudflare Workers through OpenNext. The production design (sky) is previewed at https://pilotprotocol-sky.marketized.io.

  • Removed: the Astro sources and config (src/, astro.config.mjs, scripts/, public/, functions/, _headers, wrangler.toml, tsconfig.json), the notes in docs/ (they describe the old /cloud-teaser, /cloud-landing and /pilot-film pages), and .github/workflows/plain-sync.yml, which regenerated the /plain twins.
  • Added: the new site (src/, content/, seed/, public/, scripts/, next.config.ts, wrangler.jsonc).
  • Kept as they were: LICENSE, worker/, sync-install-sh.yml. Updated for the new commands: README.md, CONTRIBUTING.md, AGENTS.md (the writing rules stay; the pre-PR checks changed and the Next.js block that next dev writes is appended), ci.yml, and one CHANGELOG.md entry.
  • Every blog, learning center and news post on main is in seed/posts (checked by slug), and every docs page is in content/docs.
  • public/_redirects carries over the 79 old redirects whose targets exist in the new site. /plain/docs/<page> goes to /docs/<page>, the rest of /plain to /llms.txt, and the /plain section of llms.txt now points at the Markdown docs. SKILLS.md and agents.txt stay at their URLs, since llms.txt links them.

How it's built

  • Docs: MDX in content/docs, rendered with Fumadocs. Search at /api/search; any page as Markdown at /docs/<page>.mdx.
  • Posts: Payload CMS 3, data in D1, uploads in R2, admin at /admin. The blog, learning center, newsroom, /about, the feed and the sitemap read Payload per request; everything else is prerendered.
  • Two designs from one codebase, picked by NEXT_PUBLIC_SITE_VARIANT at build time. Production builds sky; green deploys to a second Worker on workers.dev.

Changes from the preview source, to fit this repo:

  • wrangler.jsonc: production Worker pilot-protocol-website with pilotprotocol.network as a custom domain, and env.green on workers.dev only. No account_id: Wrangler takes it from CLOUDFLARE_ACCOUNT_ID, as CI does today. database_id is REPLACE_WITH_D1_DATABASE_ID. Binding names (D1, R2, ASSETS) are unchanged.
  • package.json: deploy:app builds sky for pilotprotocol.network; deploy:green replaces deploy:sky.
  • next.config.ts: the noindex header covers *.workers.dev only (the marketized.io preview hosts are gone). The build runs one Next.js worker: with two or more, each opens the local D1 through Wrangler's platform proxy and the build fails with SQLITE_BUSY. Reproduced in a fresh clone with 13 and with 3 workers.
  • scripts/sync-install.mjs refreshes public/install.sh from pilot-protocol/release, the copy sync-install-sh.yml checks against (the file is byte-identical today).
  • tsconfig.json and eslint.config.mjs skip worker/, which has its own setup.

How to run it

npm install
cp .env.example .env    # PAYLOAD_SECRET: openssl rand -hex 32
npm run migrate
npm run seed
npm run dev             # http://localhost:3000, admin at /admin
NEXT_PUBLIC_SITE_VARIANT=sky npm run dev    # the production design

How to deploy

One time, on the account that holds the pilotprotocol.network zone:

  1. wrangler d1 create pilot-protocol-website and wrangler r2 bucket create pilot-protocol-website-media, then put the database id in the three database_id fields.
  2. wrangler secret put PAYLOAD_SECRET, and again with --env green.
  3. npm run deploy:database, then npm run seed:production to import the posts.
  4. In pilot-protocol/release, narrow the pilot-release route pilotprotocol.network/api/* to pilotprotocol.network/api/changelog. That Worker answers 404 for every other /api path, so as it stands docs search, uploaded images and the Payload admin would break on the production domain.
  5. Remove pilotprotocol.network from the Pages project pilotprotocol, then run npm run deploy.

/install.sh and /.well-known/* keep coming from pilot-release: Worker routes run in front of a custom domain.

After the first deploy, CI deploys when the ci workflow is started by hand on main. It runs npm run deploy with the CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets. The current token is scoped to Pages; it needs Workers Scripts, Workers Routes, D1 and R2 edit rights.

What reviewers should check

Left out

  • The /cloud-teaser, /cloud-landing and /pilot-film pages.
  • The Pages Functions in functions/. The contact and disclosure forms now open the visitor's mail app, so RESEND_API_KEY and the Turnstile keys are unused.
  • Old public files nothing in the new site links: the blog banners, /research/polo/protocol-comparison.pdf, /demo/pilot-demo.mp4, the old og/ images. public/.well-known/ was already shadowed by pilot-release.

Checks run

  • npm install, npx next typegen && npx tsc --noEmit, npm run lint: pass.
  • npx opennextjs-cloudflare build with NEXT_PUBLIC_SITE_VARIANT=sky, in a fresh clone: pass.
  • npx wrangler deploy --dry-run, default and --env green: pass.
  • wrangler dev on that build: home, docs, /docs/*.mdx, search, blog, learn, news, feed, sitemap and /admin return 200, and the redirects return 301 to their targets.
  • The new ci.yml on this branch: pass.

Replaces the Astro site with Next.js 16 on Cloudflare Workers through
OpenNext. Docs are MDX in content/docs, rendered with Fumadocs; blog,
learning center and newsroom posts live in Payload CMS on D1 and R2.
Production builds the sky design for pilotprotocol.network; the green
design deploys to workers.dev with npm run deploy:green.
@TeoSlayer
TeoSlayer merged commit b305535 into main Nov 16, 2026
1 of 2 checks passed
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.

2 participants