Skip to content

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

fix: issue with NextSeo not adding <title> tag in correctly. fixed up homepage meta data

Jonathan Summers-Muir342697ab4d23
diff --git a/apps/docs/layouts/DefaultLayout.tsx b/apps/docs/layouts/DefaultLayout.tsx
index 0a6b48c5547..6117ea9a473 100644
--- a/apps/docs/layouts/DefaultLayout.tsx
+++ b/apps/docs/layouts/DefaultLayout.tsx
@@ -1,5 +1,6 @@
import { MDXProvider } from '@mdx-js/react'
import Head from 'next/head'
+import { useRouter } from 'next/router'
import { FC } from 'react'
import components from '~/components'
import TableOfContents from '~/components/TableOfContents'
@@ -12,14 +13,20 @@ interface Props {
}
const Layout: FC<Props> = (props: Props) => {
+ const { asPath } = useRouter()
+
const hasTableOfContents =
props.toc !== undefined &&
props.toc.json.filter((item) => item.lvl !== 1 && item.lvl <= 3).length > 0
+ console.log('asPath', asPath)
+
return (
<>
<Head>
- <title>{props.meta?.title} | Supabase Docs</title>
+ <title>
+ {asPath === '/' ? 'Supabase Docs' : `${props.meta?.title} | Supabase Docadsdsds`}
+ </title>
<meta name="description" content={props.meta?.description} />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="/docs/favicon.ico" />
diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx
index 5899d282fc7..e1ee0e97123 100644
--- a/apps/docs/layouts/guides/index.tsx
+++ b/apps/docs/layouts/guides/index.tsx
@@ -1,5 +1,6 @@
import { MDXProvider } from '@mdx-js/react'
import { NextSeo } from 'next-seo'
+import Head from 'next/head'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { FC, useEffect, useRef, useState } from 'react'
@@ -67,13 +68,13 @@ const Layout: FC<Props> = (props) => {
return (
<>
+ <Head>
+ <title>{props.meta?.title} | Supabase Docs</title>
+ <meta name="description" content={props.meta?.description} />
+ </Head>
<NextSeo
- title={`${props.meta?.title} | Supabase Docs`}
- description={props.meta?.description ? props.meta?.description : props.meta?.title}
canonical={props.meta?.canonical ?? `https://supabase.com/docs${asPath}`}
openGraph={{
- title: props.meta?.title,
- description: props.meta?.description,
url: `https://supabase.com/docs${asPath}`,
type: 'article',
videos: props.meta?.video && [
diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx
index 4a3f65a5680..456e136655f 100644
--- a/apps/docs/pages/_app.tsx
+++ b/apps/docs/pages/_app.tsx
@@ -66,8 +66,6 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
<>
<Favicons />
<DefaultSeo
- title={SITE_TITLE}
- description={SITE_DESCRIPTION}
openGraph={{
type: 'website',
url: 'https://supabase.com/docs',