Commit 047a44c
authored
fix: statically generate individual team pages (#17458)
* fix: serve individual team pages on direct load
Individual team pages (e.g. /teams/query-performance) are Gatsby client-only routes built from src/pages/teams/[slug].tsx, which only produces a single SPA shell at /teams/[slug]/index.html. Like the existing /posts, /questions, and /community/profiles client-only routes, they need a Vercel rewrite pointing the dynamic path at that shell. Without it, direct requests find no static file and fall through to 404.
Add a /teams/:slug -> /teams/[slug]/index.html rewrite. The existing /teams/new static page is unaffected since Vercel checks the filesystem before applying rewrites.
Generated-By: PostHog Code
Task-Id: a3abc22f-4430-4431-b265-e661db7ad958
* fix: statically generate team pages so direct loads work on all hosts
The previous approach (a /teams/:slug Vercel rewrite) only works on Vercel — it isn't honored by the Cloudflare Pages preview, where individual team pages still 404 on direct load.
Convert src/pages/teams/[slug].tsx (a client-only route that produced a single SPA shell) into a Gatsby collection route, src/pages/teams/{SqueakTeam.slug}.tsx. Gatsby now pre-renders a real static page per team at /teams/<slug>, so direct loads resolve on every host — Vercel production, the Cloudflare Pages preview, and local — with no host-specific routing rules. The component is unchanged: it still reads props.params.slug and fetches live team data client-side via useTeam.
Removes the now-redundant /teams/:slug rewrite from vercel.json since real HTML files exist at each path.
Generated-By: PostHog Code
Task-Id: a3abc22f-4430-4431-b265-e661db7ad9581 parent 1626715 commit 047a44c
1 file changed
File renamed without changes.
0 commit comments