diff --git a/apps/docs/layouts/Default.tsx b/apps/docs/layouts/Default.tsx index 186bb39307b..515f73b89ac 100644 --- a/apps/docs/layouts/Default.tsx +++ b/apps/docs/layouts/Default.tsx @@ -12,8 +12,8 @@ interface Props { meta: { title: string; description?: string; hide_table_of_contents?: boolean } children: any toc?: any - menuItems: any - currentPage: string + menuItems?: any + currentPage?: string } const Layout: FC = ({ meta, children, toc }) => { diff --git a/apps/docs/layouts/DefaultGuideLayout.tsx b/apps/docs/layouts/DefaultGuideLayout.tsx index 8d63d041092..ea39047c4dd 100644 --- a/apps/docs/layouts/DefaultGuideLayout.tsx +++ b/apps/docs/layouts/DefaultGuideLayout.tsx @@ -5,7 +5,7 @@ interface Props { meta: { title: string; description?: string; hide_table_of_contents?: boolean; video?: string } children: any toc?: any - currentPage: string + currentPage?: string } const Layout: FC = (props) => { diff --git a/apps/docs/layouts/guides/archived.tsx b/apps/docs/layouts/guides/archived.tsx index 3d8b900c887..7ec09aaebfc 100644 --- a/apps/docs/layouts/guides/archived.tsx +++ b/apps/docs/layouts/guides/archived.tsx @@ -14,7 +14,7 @@ interface Props { meta: { title: string; description?: string; hide_table_of_contents?: boolean } children: any toc?: any - currentPage: string + currentPage?: string } const Layout: FC = ({ meta, children }) => { diff --git a/apps/docs/layouts/guides/current.tsx b/apps/docs/layouts/guides/current.tsx index 48c1f4f90fa..00a1a45a09f 100644 --- a/apps/docs/layouts/guides/current.tsx +++ b/apps/docs/layouts/guides/current.tsx @@ -18,7 +18,7 @@ interface Props { } children: any toc?: any - currentPage: string + currentPage?: string } const Layout: FC = (props) => { diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx index 9e551480ebc..59a33376068 100644 --- a/apps/docs/layouts/guides/index.tsx +++ b/apps/docs/layouts/guides/index.tsx @@ -6,7 +6,7 @@ interface Props { meta: { title: string; description?: string; hide_table_of_contents?: boolean; video?: string } children: any toc?: any - currentPage: string + currentPage?: string } const Layout: FC = (props) => { diff --git a/apps/docs/pages/404.mdx b/apps/docs/pages/404.mdx new file mode 100644 index 00000000000..b75a4a59620 --- /dev/null +++ b/apps/docs/pages/404.mdx @@ -0,0 +1,13 @@ +import Layout from '~/layouts/DefaultGuideLayout' + +export const meta = { + id: '404', + title: '404 not found', + description: '404 not found', +} + +404 not found + +export const Page = ({ children }) => + +export default Page diff --git a/apps/docs/pages/[...slug].tsx b/apps/docs/pages/[...slug].tsx new file mode 100644 index 00000000000..6b34513a155 --- /dev/null +++ b/apps/docs/pages/[...slug].tsx @@ -0,0 +1,74 @@ +import toc from 'markdown-toc' +import { MDXRemote } from 'next-mdx-remote' +import { serialize } from 'next-mdx-remote/serialize' +import components from '../components/index' +import NewLayout from '~/layouts/DefaultGuideLayout' + +import Layout from '~/layouts/Default' +import { getAllDocs, getDocsBySlug } from '../lib/docs' + +interface Meta { + id: string + title: string + sidebar_label: string + hide_table_of_contents: boolean +} + +interface Props { + meta: Meta + content: any + toc: any +} +const isNewDocs = process.env.NEXT_PUBLIC_NEW_DOCS === 'true' + +export default function Doc({ meta, content, toc }: Props) { + return ( + // @ts-ignore + <> + {Object.entries(meta).length > 0 || !isNewDocs ? ( + + + + ) : ( + + + + )} + + ) +} + +export async function getStaticProps({ params }: { params: { slug: string[] } }) { + let slug + if (params.slug.length > 1) { + slug = `docs/${params.slug.join('/')}` + } else { + slug = `docs/${params.slug[0]}` + } + + let doc = getDocsBySlug(slug) + const content = await serialize(doc.content || '') + + return { + props: { + ...doc, + content, + toc: toc(doc.content, { maxdepth: 1, firsth1: false }), + }, + } +} + +export function getStaticPaths() { + let docs = getAllDocs() + + return { + paths: docs.map(() => { + return { + params: { + slug: docs.map((d) => d.slug), + }, + } + }), + fallback: 'blocking', + } +} diff --git a/apps/docs/public/sitemap.xml b/apps/docs/public/sitemap.xml index 023980c4ded..73d015d9034 100644 --- a/apps/docs/public/sitemap.xml +++ b/apps/docs/public/sitemap.xml @@ -102,6 +102,24 @@ 0.5 + + https://supabase.com/docs/new/auth + weekly + 0.5 + + + + https://supabase.com/docs/new/database + weekly + 0.5 + + + + https://supabase.com/docs/new/index + weekly + 0.5 + + https://supabase.com/docs/guides/api weekly @@ -246,12 +264,6 @@ 0.5 - - https://supabase.com/docs/tutorials/nextjs - weekly - 0.5 - - https://supabase.com/docs/reference/index weekly @@ -259,19 +271,7 @@ - https://supabase.com/docs/new/auth - weekly - 0.5 - - - - https://supabase.com/docs/new/database - weekly - 0.5 - - - - https://supabase.com/docs/new/index + https://supabase.com/docs/tutorials/nextjs weekly 0.5 @@ -324,114 +324,24 @@ 0.5 + + https://supabase.com/docs/new/auth/auth-login + weekly + 0.5 + + + + https://supabase.com/docs/new/tutorials/nextjs + weekly + 0.5 + + https://supabase.com/docs/guides/api/generating-types weekly 0.5 - - https://supabase.com/docs/guides/cli/local-development - weekly - 0.5 - - - - https://supabase.com/docs/guides/cli/managing-environments - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/arrays - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/connecting-to-postgres - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/extensions - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/full-text-search - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/functions - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/json - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/managing-passwords - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/managing-timezones - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/overview - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/replication - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/sql-to-api - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/tables - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/testing - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/timeouts - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/webhooks - weekly - 0.5 - - https://supabase.com/docs/guides/auth/auth-apple weekly @@ -618,6 +528,108 @@ 0.5 + + https://supabase.com/docs/guides/cli/local-development + weekly + 0.5 + + + + https://supabase.com/docs/guides/cli/managing-environments + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/arrays + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/connecting-to-postgres + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/extensions + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/full-text-search + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/functions + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/json + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/managing-passwords + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/managing-timezones + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/overview + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/replication + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/sql-to-api + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/tables + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/testing + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/timeouts + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/webhooks + weekly + 0.5 + + https://supabase.com/docs/guides/functions/auth weekly @@ -660,6 +672,30 @@ 0.5 + + https://supabase.com/docs/guides/migrations/firebase-auth + weekly + 0.5 + + + + https://supabase.com/docs/guides/migrations/firebase-storage + weekly + 0.5 + + + + https://supabase.com/docs/guides/migrations/firestore-data + weekly + 0.5 + + + + https://supabase.com/docs/guides/migrations/heroku + weekly + 0.5 + + https://supabase.com/docs/guides/integrations/appsmith weekly @@ -799,25 +835,19 @@ - https://supabase.com/docs/guides/migrations/firebase-auth + https://supabase.com/docs/guides/realtime/postgres-changes weekly 0.5 - https://supabase.com/docs/guides/migrations/firebase-storage + https://supabase.com/docs/guides/realtime/quickstart weekly 0.5 - https://supabase.com/docs/guides/migrations/firestore-data - weekly - 0.5 - - - - https://supabase.com/docs/guides/migrations/heroku + https://supabase.com/docs/guides/realtime/rate-limits weekly 0.5 @@ -876,24 +906,6 @@ 0.5 - - https://supabase.com/docs/guides/realtime/postgres-changes - weekly - 0.5 - - - - https://supabase.com/docs/guides/realtime/quickstart - weekly - 0.5 - - - - https://supabase.com/docs/guides/realtime/rate-limits - weekly - 0.5 - - https://supabase.com/docs/guides/resources/examples weekly @@ -1033,13 +1045,31 @@ - https://supabase.com/docs/new/auth/auth-login + https://supabase.com/docs/guides/auth/auth-helpers/auth-ui weekly 0.5 - https://supabase.com/docs/new/tutorials/nextjs + https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-helpers/nextjs + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-helpers/remix + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-helpers/sveltekit weekly 0.5 @@ -1080,48 +1110,6 @@ 0.5 - - https://supabase.com/docs/guides/auth/auth-helpers/auth-ui - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-helpers/nextjs - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-helpers/remix - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-helpers/sveltekit - weekly - 0.5 - - - - https://supabase.com/docs/guides/functions/examples/index - weekly - 0.5 - - - - https://supabase.com/docs/guides/functions/examples/og-image - weekly - 0.5 - - https://supabase.com/docs/guides/auth/passwordless-login/email-otp-magic-link weekly @@ -1146,6 +1134,18 @@ 0.5 + + https://supabase.com/docs/guides/functions/examples/index + weekly + 0.5 + + + + https://supabase.com/docs/guides/functions/examples/og-image + weekly + 0.5 + + https://supabase.com/docs/guides/auth/social-login/auth-apple weekly @@ -1254,6 +1254,12 @@ 0.5 + + https://supabase.com/docs/guides/resources/self-hosting/docker + weekly + 0.5 + + https://supabase.com/docs/guides/resources/migrating-to-supabase/firebase-auth weekly @@ -1278,12 +1284,6 @@ 0.5 - - https://supabase.com/docs/guides/resources/self-hosting/docker - weekly - 0.5 - - https://supabase.com/docs/guides/resources/supabase-cli/local-development weekly @@ -1362,6 +1362,18 @@ 0.5 + + https://supabase.com/docs/reference/javascript/abort-signal + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/admin-api + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/auth-admin-createuser weekly @@ -1440,6 +1452,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/auth-reset-password-for-email + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/auth-resetpasswordforemail weekly @@ -1494,6 +1512,66 @@ 0.5 + + https://supabase.com/docs/reference/javascript/auth.getsession + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.getuser + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.onauthstatechange + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.refreshsession + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.setsession + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.signinwithoauth + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.signinwithotp + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.updateuser + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.verifyotp + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/contained-by + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/containedby weekly @@ -1506,6 +1584,18 @@ 0.5 + + https://supabase.com/docs/reference/javascript/create-user + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/csv + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/db-abortsignal weekly @@ -1524,12 +1614,30 @@ 0.5 + + https://supabase.com/docs/reference/javascript/delete-bucket + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/delete-user + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/delete weekly 0.5 + + https://supabase.com/docs/reference/javascript/empty-bucket + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/eq weekly @@ -1542,6 +1650,102 @@ 0.5 + + https://supabase.com/docs/reference/javascript/from-copy + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-create-signed-url + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-create-signed-urls + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-download + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-get-public-url + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-list + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-move + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-remove + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-update + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-upload + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/generate-link + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-bucket + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-channels + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-session + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-user-by-id + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-user + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/getchannels weekly @@ -1590,6 +1794,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/invite-user-by-email + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/invoke weekly @@ -1614,6 +1824,18 @@ 0.5 + + https://supabase.com/docs/reference/javascript/list-buckets + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/list-users + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/lt weekly @@ -1633,7 +1855,7 @@ - https://supabase.com/docs/reference/javascript/maybesingle + https://supabase.com/docs/reference/javascript/maybeSingle weekly 0.5 @@ -1650,6 +1872,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/on-auth-state-change + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/or weekly @@ -1668,6 +1896,36 @@ 0.5 + + https://supabase.com/docs/reference/javascript/range-adjacent + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-gt + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-gte + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-lt + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-lte + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/range weekly @@ -1704,6 +1962,24 @@ 0.5 + + https://supabase.com/docs/reference/javascript/refresh-session + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/remove-all-channels + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/remove-channel + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/removeallchannels weekly @@ -1728,6 +2004,42 @@ 0.5 + + https://supabase.com/docs/reference/javascript/set-session + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-in-with-oauth + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-in-with-otp + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-in-with-password + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-out + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-up + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/single weekly @@ -1746,6 +2058,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/storage-empty-bucket + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/storage-emptybucket weekly @@ -1842,6 +2160,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/text-search + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/textsearch weekly @@ -1854,6 +2178,24 @@ 0.5 + + https://supabase.com/docs/reference/javascript/update-bucket + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/update-user-by-id + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/update-user + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/update weekly @@ -1878,6 +2220,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/verify-otp + weekly + 0.5 + + https://supabase.com/docs/reference/dart/initializing weekly @@ -2058,6 +2406,12 @@ 0.5 + + https://supabase.com/docs/reference/dart/initializing + weekly + 0.5 + + https://supabase.com/docs/reference/dart/insert weekly @@ -2232,12 +2586,6 @@ 0.5 - - https://supabase.com/docs/reference/dart/storage-from-createsignedurls - weekly - 0.5 - - https://supabase.com/docs/reference/dart/storage-from-download weekly