Skip to content

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

capitalize type of page for og image

Jonathan Summers-Muir8d25c826994b
diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx
index 66772a595a8..aa0bc040e92 100644
--- a/apps/docs/layouts/guides/index.tsx
+++ b/apps/docs/layouts/guides/index.tsx
@@ -64,10 +64,18 @@ const Layout: FC<Props> = (props) => {
const hasTableOfContents = tocList.length > 0
+ // page type, ie, Auth, Database, Storage etc
const ogPageType = asPath.split('/')[2]
-
+ const ogPageTypeSplit = ogPageType.split(' ')
+ // capitalize each word for page type
+ ogPageTypeSplit
+ .map((word) => {
+ return word[0].toUpperCase() + word.substring(1)
+ })
+ .join(' ')
+ // open graph image url constructor
const ogImageUrl = `https://obuldanrptloktxcffvn.functions.supabase.co/og-images?site=docs${
- ogPageType ? `&type=${ogPageType}` : ''
+ ogPageTypeSplit ? `&type=${ogPageTypeSplit}` : ''
}&title=${encodeURIComponent(props.meta?.title)}&description=${encodeURIComponent(
props.meta?.description
)}`
diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx
index 4aa3201e2b9..7d1da80d098 100644
--- a/apps/docs/pages/_app.tsx
+++ b/apps/docs/pages/_app.tsx
@@ -67,11 +67,11 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
<Head>
<meta
property="og:image"
- content={`https://supabase.com${basePath}/img/supabase-og-image.png`}
+ content={`https://supabase.com${router.basePath}/img/supabase-og-image.png`}
/>
<meta
name="twitter:image"
- content={`https://supabase.com${basePath}/img/supabase-og-image.png`}
+ content={`https://supabase.com${router.basePath}/img/supabase-og-image.png`}
/>
</Head>
<DefaultSeo