The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat(www): homepage json-ld, canonical, 404 links (#49533)
Pamela Chia013af4ed5801
diff --git a/apps/www/app/(home)/page.tsx b/apps/www/app/(home)/page.tsxindex 26e4afba594..8aa34bd438c 100644--- a/apps/www/app/(home)/page.tsx+++ b/apps/www/app/(home)/page.tsx@@ -2,12 +2,28 @@ import type { Metadata } from 'next'import { FrameworksSection } from './_components/FrameworksSection'import { HomeContent } from './_components/HomeContent'+import { organizationSchema, serializeJsonLd, websiteSchema } from '@/lib/json-ld'import { mdAlternates } from '@/lib/md-alternates'export const metadata: Metadata = {- alternates: mdAlternates('index'),+ alternates: {+ ...mdAlternates('index'),+ canonical: 'https://supabase.com',+ },}export default function HomePage() {- return <HomeContent frameworksSlot={<FrameworksSection />} />+ return (+ <>+ <script+ type="application/ld+json"+ dangerouslySetInnerHTML={{ __html: serializeJsonLd(organizationSchema()) }}+ />+ <script+ type="application/ld+json"+ dangerouslySetInnerHTML={{ __html: serializeJsonLd(websiteSchema()) }}+ />+ <HomeContent frameworksSlot={<FrameworksSection />} />+ </>+ )}diff --git a/apps/www/components/Error404.tsx b/apps/www/components/Error404.tsxindex f2e6e5c3a41..5032d9d7eda 100644--- a/apps/www/components/Error404.tsx+++ b/apps/www/components/Error404.tsx@@ -30,17 +30,17 @@ const Error404 = () => {</div></nav></div>- <div className="absolute">- <h1- className={`text-foreground select-none text-[14rem] opacity-5 filter transition duration-200 sm:text-[18rem] lg:text-[28rem] ${+ <div className="pointer-events-none absolute" aria-hidden="true">+ <div+ className={`text-foreground select-none text-[14rem] opacity-5 filter transition duration-200 motion-reduce:transition-none sm:text-[18rem] lg:text-[28rem] ${show404 ? 'blur-xs' : 'blur-none'}`}>404- </h1>+ </div></div><div- className={`flex flex-col items-center justify-center space-y-6 transition ${+ className={`flex flex-col items-center justify-center space-y-6 transition motion-reduce:transition-none ${show404 ? 'opacity-100' : 'opacity-0'}`}>@@ -55,6 +55,19 @@ const Error404 = () => {<Link href="/">Head back</Link></Button></div>+ <p className="text-foreground-lighter text-xs">+ <a href="/docs" className="hover:text-foreground underline">+ Documentation+ </a>+ {' · '}+ <a href="/sitemap.xml" className="hover:text-foreground underline">+ Sitemap+ </a>+ {' · '}+ <a href="/llms.txt" className="hover:text-foreground underline">+ llms.txt+ </a>+ </p></div></div></DefaultLayout>diff --git a/apps/www/md-alternates.test.ts b/apps/www/md-alternates.test.tsindex 1f1fdde175b..d610d636063 100644--- a/apps/www/md-alternates.test.ts+++ b/apps/www/md-alternates.test.ts@@ -65,9 +65,10 @@ describe('markdown alternate drift', () => {const appPagePath = appPages.get(slug)if (appPagePath) {const source = await fs.readFile(appPagePath, 'utf-8')+ const wiringShapes = [`alternates: mdAlternates('${slug}')`, `...mdAlternates('${slug}')`]expect(- source.includes(`alternates: mdAlternates('${slug}')`),- `${path.relative(process.cwd(), appPagePath)} must contain "alternates: mdAlternates('${slug}')" in its metadata export`+ wiringShapes.some((shape) => source.includes(shape)),+ `${path.relative(process.cwd(), appPagePath)} must wire mdAlternates('${slug}') into its metadata export, either as "alternates: mdAlternates('${slug}')" or spread into a wider alternates object as "...mdAlternates('${slug}')"`).toBe(true)} else {expect(