Files
supabase/apps/ui-library/app/layout.tsx
Kody Jackson a23ab5ef9e fix(ui-library) - add in core SEO features (#52567)
## Problem

The UI was missing several common SEO affordances, including:
- canonical URLs
- JSON+LD structured data (`TechArticle`, `BreadcrumbList`)
- a sitemap

Also the [examples
pages](https://supabase.com/library/example/password-based-auth/auth/sign-up)
should be tagged with `noindex` b/c they're demo webpages.

## Solution

Adds these + adds the newly created sitemap to the apps/www listing.

## Preview links

### Sitemap


https://ui-library-git-kody-devrel-815-seo-tweaks-ui-library-supabase.vercel.app/library/sitemap.xml
<img width="1338" height="669" alt="image"
src="https://github.com/user-attachments/assets/75bdbfa0-1294-4ed2-a045-fc76d2c8f133"
/>

### Canonical URLs

Also fixed a bug in the og:url property, where it didn't set the
`/library` and instead rendered `undefined`.

**Previous**

https://supabase.com/library/docs/nextjs/password-based-auth
<img width="1338" height="702" alt="image"
src="https://github.com/user-attachments/assets/90561e30-f5b0-4a91-b19d-340b542c996d"
/>


**New**


https://ui-library-git-kody-devrel-815-seo-tweaks-ui-library-supabase.vercel.app/library/docs/nextjs/password-based-auth
<img width="1338" height="702" alt="image"
src="https://github.com/user-attachments/assets/2bdf34b2-2cc2-4b50-b57b-807835ba5d01"
/>

### JSON-LD

-
[preview](https://ui-library-git-kody-devrel-815-seo-tweaks-ui-library-supabase.vercel.app/library/docs/nextjs/password-based-auth)
-
[validation](https://validator.schema.org/#url=https%3A%2F%2Fui-library-git-kody-devrel-815-seo-tweaks-ui-library-supabase.vercel.app%2Flibrary%2Fdocs%2Fnextjs%2Fpassword-based-auth)

<img width="1338" height="702" alt="image"
src="https://github.com/user-attachments/assets/25627028-c37a-4940-ad6d-0d85d31f3ef9"
/>

### Examples

Now have a `noindex` value on them.


https://ui-library-git-kody-devrel-815-seo-tweaks-ui-library-supabase.vercel.app/library/example/password-based-auth/auth/sign-up

<img width="1338" height="702" alt="image"
src="https://github.com/user-attachments/assets/16f30d8c-8471-43e0-a55c-e6dc30e326e0"
/>
2026-11-02 08:00:28 -06:00

71 lines
2.2 KiB
TypeScript

import type { Metadata } from 'next'
import '@/styles/globals.css'
import { FeatureFlagProvider, TelemetryTagManager } from 'common'
import { genFaviconData } from 'common/MetaFavicons/app-router'
import { Inter, Manrope, Source_Code_Pro } from 'next/font/google'
import { Providers } from './Providers'
import { Toaster } from './toaster'
import { libraryUrl } from '@/lib/canonical'
import { API_URL } from '@/lib/constants'
const inter = Inter({ subsets: ['latin'], variable: '--font-inter', display: 'swap' })
const manrope = Manrope({ subsets: ['latin'], variable: '--font-manrope', display: 'swap' })
const sourceCodePro = Source_Code_Pro({
subsets: ['latin'],
variable: '--font-source-code-pro',
display: 'swap',
})
const BASE_PATH = process.env.NEXT_PUBLIC_BASE_PATH ?? ''
const FAVICON_ROUTE = process.env.NODE_ENV === 'development' ? '/favicon/local' : '/favicon'
export const metadata: Metadata = {
applicationName: 'Supabase Library',
title: 'Supabase Library',
description: 'Supabase blocks and starter apps for authentication, storage, realtime, and more',
metadataBase: new URL('https://supabase.com'),
icons: genFaviconData(BASE_PATH, FAVICON_ROUTE),
manifest: `${BASE_PATH}${FAVICON_ROUTE}/manifest.json`,
openGraph: {
type: 'article',
authors: 'Supabase',
url: libraryUrl(''),
images: `${BASE_PATH}/img/supabase-og-image.png`,
publishedTime: new Date().toISOString(),
modifiedTime: new Date().toISOString(),
},
twitter: {
card: 'summary_large_image',
site: '@supabase',
creator: '@supabase',
images: `${BASE_PATH}/img/supabase-og-image.png`,
},
}
interface RootLayoutProps {
children: React.ReactNode
}
export default async function Layout({ children }: RootLayoutProps) {
return (
<html lang="en" data-scroll-behavior="smooth" suppressHydrationWarning>
<head />
<body
className={`${inter.variable} ${manrope.variable} ${sourceCodePro.variable} font-sans antialiased`}
>
<TelemetryTagManager />
<FeatureFlagProvider API_URL={API_URL}>
<Providers>
{children}
<Toaster />
</Providers>
</FeatureFlagProvider>
</body>
</html>
)
}