From 0add2bd8e509fddc25ece557da5c86d6882cb33b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 2 May 2026 22:47:34 +0000 Subject: [PATCH 1/2] feat(web): add page-specific metadata for SEO and social sharing --- apps/web/app/(public)/layout.tsx | 9 +++++++++ .../app/tipping/add-tips/[race-id]/page.tsx | 19 +++++++++++++++++++ apps/web/app/tipping/add-tips/page.tsx | 1 + apps/web/app/tipping/championships/page.tsx | 7 +++++++ apps/web/app/tipping/group-admin/page.tsx | 7 +++++++ apps/web/app/tipping/groups/page.tsx | 7 +++++++ apps/web/app/tipping/page.tsx | 7 +++++++ 7 files changed, 57 insertions(+) diff --git a/apps/web/app/(public)/layout.tsx b/apps/web/app/(public)/layout.tsx index e32a8ec..55abb00 100644 --- a/apps/web/app/(public)/layout.tsx +++ b/apps/web/app/(public)/layout.tsx @@ -4,6 +4,15 @@ import { Button } from '@ui/button' import { Path } from '@/lib/utils/path' import { getMaybeSession } from '@/lib/dal' import { webRoutes } from '@gridtip/shared/routes' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: { + absolute: 'GridTip – F1 Tipping with Friends', + }, + description: + 'Predict the outcome of every Formula One race weekend with your friends. Join a group, tip the podium, and battle for the tipping championship.', +} export default async function DefaultLayout({ children, diff --git a/apps/web/app/tipping/add-tips/[race-id]/page.tsx b/apps/web/app/tipping/add-tips/[race-id]/page.tsx index 3e0d4f0..8a7a6da 100644 --- a/apps/web/app/tipping/add-tips/[race-id]/page.tsx +++ b/apps/web/app/tipping/add-tips/[race-id]/page.tsx @@ -21,6 +21,25 @@ import { getTips } from '@/lib/get-tips' import { getIsSprint } from '@gridtip/shared/is-sprint' import { getDriverOptions } from '@/lib/utils/drivers' import { getConstructorOptions } from '@/lib/utils/constructors' +import type { Metadata } from 'next' + +export async function generateMetadata({ + params, +}: { + params: Promise<{ 'race-id': string }> +}): Promise { + const { 'race-id': raceId } = await params + const race = await getRaceDetails(raceId) + + if (!race) { + return { title: 'Enter tips' } + } + + return { + title: `Tip the ${race.raceName}`, + description: `Predict pole, P1, P10, last and the constructor with the most points for the ${race.raceName} at ${race.circuitName}.`, + } +} export default async function RaceFormPage({ params, diff --git a/apps/web/app/tipping/add-tips/page.tsx b/apps/web/app/tipping/add-tips/page.tsx index eb020c2..e2ece26 100644 --- a/apps/web/app/tipping/add-tips/page.tsx +++ b/apps/web/app/tipping/add-tips/page.tsx @@ -6,6 +6,7 @@ import { redirect } from 'next/navigation' export const metadata: Metadata = { title: 'Enter tips', + description: 'Tip the next Formula One Grand Prix weekend.', } export default async function AddTipping() { diff --git a/apps/web/app/tipping/championships/page.tsx b/apps/web/app/tipping/championships/page.tsx index 0affd70..ad8cf1a 100644 --- a/apps/web/app/tipping/championships/page.tsx +++ b/apps/web/app/tipping/championships/page.tsx @@ -27,6 +27,13 @@ import { ChampionshipsTipData } from './actions/schema' import { getFirstRace } from '@/lib/utils/races' import { getDriverOptions } from '@/lib/utils/drivers' import { getConstructorOptions } from '@/lib/utils/constructors' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Championships', + description: + 'Predict the Formula One Drivers’ and Constructors’ champions for the season.', +} export default async function ChampionshipPage() { const { userId } = await verifySession() diff --git a/apps/web/app/tipping/group-admin/page.tsx b/apps/web/app/tipping/group-admin/page.tsx index 6ba6de0..f9f8420 100644 --- a/apps/web/app/tipping/group-admin/page.tsx +++ b/apps/web/app/tipping/group-admin/page.tsx @@ -18,6 +18,13 @@ import { ChampionshipPoints } from './_components/championship-points' import { getRaces } from '@/lib/utils/races' import { getConstructorOptions } from '@/lib/utils/constructors' import { getDriverOptions } from '@/lib/utils/drivers' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Group Admin', + description: + 'Manage tips and championship points for members of your tipping group.', +} export default async function GroupSettings() { const { userId } = await verifySession() diff --git a/apps/web/app/tipping/groups/page.tsx b/apps/web/app/tipping/groups/page.tsx index cb7897c..b073e60 100644 --- a/apps/web/app/tipping/groups/page.tsx +++ b/apps/web/app/tipping/groups/page.tsx @@ -25,6 +25,13 @@ import { Badge } from '@/components/ui/badge' import { Suspense } from 'react' import EditGroup from './_components/edit-group' import { MemberStatus } from '@/types' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Groups', + description: + 'Manage your tipping groups, invite friends, or join an existing group.', +} export default async function GroupsPage() { const { userId, user } = await verifySession() diff --git a/apps/web/app/tipping/page.tsx b/apps/web/app/tipping/page.tsx index 28e8469..71eb1f1 100644 --- a/apps/web/app/tipping/page.tsx +++ b/apps/web/app/tipping/page.tsx @@ -51,6 +51,13 @@ import { FlagBackgroundCard } from './_components/card-flag-background' import { CardEveryonesTips } from './_components/card-group-tips' import { RaceHeader } from './_components/race-header' import { getIsSprint } from '@gridtip/shared/is-sprint' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Dashboard', + description: + 'Your tipping dashboard – see the next race, group tips, and championship reveals.', +} export default async function DashboardPage() { const { userId, user: _ } = await verifySession() From a91cbc71690ac26a31f6c561bd514f34a6122f6c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 May 2026 02:43:52 +0000 Subject: [PATCH 2/2] tweak race meta title and dashboard description --- apps/web/app/tipping/add-tips/[race-id]/page.tsx | 4 ++-- apps/web/app/tipping/page.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/app/tipping/add-tips/[race-id]/page.tsx b/apps/web/app/tipping/add-tips/[race-id]/page.tsx index 8a7a6da..d9e17eb 100644 --- a/apps/web/app/tipping/add-tips/[race-id]/page.tsx +++ b/apps/web/app/tipping/add-tips/[race-id]/page.tsx @@ -36,8 +36,8 @@ export async function generateMetadata({ } return { - title: `Tip the ${race.raceName}`, - description: `Predict pole, P1, P10, last and the constructor with the most points for the ${race.raceName} at ${race.circuitName}.`, + title: race.raceName, + description: `Tip the ${race.raceName}.`, } } diff --git a/apps/web/app/tipping/page.tsx b/apps/web/app/tipping/page.tsx index 71eb1f1..a1606c8 100644 --- a/apps/web/app/tipping/page.tsx +++ b/apps/web/app/tipping/page.tsx @@ -56,7 +56,7 @@ import type { Metadata } from 'next' export const metadata: Metadata = { title: 'Dashboard', description: - 'Your tipping dashboard – see the next race, group tips, and championship reveals.', + 'Your tipping dashboard – see the next race and group tips.', } export default async function DashboardPage() {