Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: Fix the `og-image` on UI library pages (#37439)

Ivan Vasilov1332d30f2f97
diff --git a/apps/ui-library/app/(app)/docs/[[...slug]]/page.tsx b/apps/ui-library/app/(app)/docs/[[...slug]]/page.tsx
index 73d81df5cbf..9bc362e67a4 100644
--- a/apps/ui-library/app/(app)/docs/[[...slug]]/page.tsx
+++ b/apps/ui-library/app/(app)/docs/[[...slug]]/page.tsx
@@ -1,8 +1,8 @@
+import { metadata as mainMetadata } from '@/app/layout'
import { FrameworkSelector } from '@/components/framework-selector'
import { Mdx } from '@/components/mdx-components'
import { SourcePanel } from '@/components/source-panel'
import { DashboardTableOfContents } from '@/components/toc'
-import { siteConfig } from '@/config/site'
import { getTableOfContents } from '@/lib/toc'
import { absoluteUrl, cn } from '@/lib/utils'
import '@/styles/code-block-variables.css'
@@ -12,7 +12,7 @@ import { ChevronRight } from 'lucide-react'
import type { Metadata } from 'next'
import { notFound } from 'next/navigation'
import Balancer from 'react-wrap-balancer'
-import { ScrollArea, Separator } from 'ui'
+import { ScrollArea } from 'ui'
interface DocPageProps {
params: Promise<{
@@ -39,31 +39,19 @@ export async function generateMetadata(props: DocPageProps): Promise<Metadata> {
return {}
}
- return {
+ const metadata: Metadata = {
+ ...mainMetadata,
title: doc.title,
description: doc.description,
openGraph: {
+ ...mainMetadata.openGraph,
title: doc.title,
description: doc.description,
type: 'article',
url: absoluteUrl(doc.slug),
- images: [
- {
- url: siteConfig.ogImage,
- width: 1200,
- height: 630,
- alt: siteConfig.name,
- },
- ],
- },
- twitter: {
- card: 'summary_large_image',
- title: doc.title,
- description: doc.description,
- images: [siteConfig.ogImage],
- creator: '@shadcn',
},
}
+ return metadata
}
export async function generateStaticParams(): Promise<{ slug: string[] }[]> {
diff --git a/apps/ui-library/components/site-footer.tsx b/apps/ui-library/components/site-footer.tsx
index a51481a3e37..739de9f1abc 100644
--- a/apps/ui-library/components/site-footer.tsx
+++ b/apps/ui-library/components/site-footer.tsx
@@ -1,5 +1,3 @@
-import { siteConfig } from '@/config/site'
-
export function SiteFooter() {
return (
<footer className="py-6 px-4 md:px-8 md:py-0 mx-auto w-full max-w-site">
@@ -7,7 +5,7 @@ export function SiteFooter() {
<p className="text-balance text-center text-sm leading-loose text-foreground-muted md:text-left">
Built by{' '}
<a
- href={siteConfig.links.twitter}
+ href="https://twitter.com/supabase"
target="_blank"
rel="noreferrer"
className="font-medium underline underline-offset-4 hover:text-foreground-lighter"
@@ -16,7 +14,7 @@ export function SiteFooter() {
</a>
. The source code is available on{' '}
<a
- href={siteConfig.links.github}
+ href="https://github.com/supabase/supabase/tree/master/apps/ui-library"
target="_blank"
rel="noreferrer"
className="font-medium underline underline-offset-4 hover:text-foreground-lighter"
@@ -28,7 +26,7 @@ export function SiteFooter() {
<p className="text-balance text-center text-sm leading-loose text-foreground-muted">
Site inspired by{' '}
<a
- href={siteConfig.links.credits.radix}
+ href="https://www.radix-ui.com/themes/docs/overview/getting-started"
target="_blank"
rel="noreferrer"
className="font-medium underline underline-offset-4 hover:text-foreground-lighter"
@@ -37,7 +35,7 @@ export function SiteFooter() {
</a>
,{' '}
<a
- href={siteConfig.links.credits.shadcn}
+ href="https://ui.shadcn.com"
target="_blank"
rel="noreferrer"
className="font-medium underline underline-offset-4 hover:text-foreground-lighter"
diff --git a/apps/ui-library/config/site.ts b/apps/ui-library/config/site.ts
deleted file mode 100644
index b68ef7790fb..00000000000
--- a/apps/ui-library/config/site.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export const siteConfig = {
- name: 'Supabase UI Library',
- url: 'https://supabase.com/ui',
- ogImage: 'https://supabase.com/ui/og.jpg',
- description: 'Provides a library of components for your project',
- links: {
- twitter: 'https://twitter.com/supabase',
- github: 'https://github.com/supabase/supabase/tree/master/apps/ui-library',
- credits: {
- radix: 'https://www.radix-ui.com/themes/docs/overview/getting-started',
- shadcn: 'https://ui.shadcn.com/',
- },
- },
-}
-
-export type SiteConfig = typeof siteConfig