The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Renaming to categories
Paul Copplestone753d4e72ae76
diff --git a/package.json b/package.jsonindex 3e28a35584c..8f4156db556 100644--- a/package.json+++ b/package.json@@ -11,14 +11,11 @@"yarn": "1.x"},"scripts": {- "build": "yarn run build:docs && yarn run build:web",- "build:docs": "yarn workspace @supabase/docs build",+ "build": "yarn run build:web","build:web": "yarn workspace @supabase/web build","deploy:web": "yarn workspace @supabase/web deploy",- "dev": "concurrently --kill-others-on-fail \"yarn dev:web\" \"yarn dev:docs\" ",- "dev:docs": "yarn workspace @supabase/docs dev",- "dev:web": "yarn workspace @supabase/web dev",- "static:web": "yarn workspace @supabase/web static"+ "dev": "concurrently --kill-others-on-fail \"yarn dev:web\" ",+ "dev:web": "yarn workspace @supabase/web dev"},"dependencies": {"concurrently": "^5.0.0"diff --git a/packages/web/components/NavbarDocs.js b/packages/web/components/NavbarDocs.jsindex e0d8a8a3ff4..5f3c2bc69a6 100644--- a/packages/web/components/NavbarDocs.js+++ b/packages/web/components/NavbarDocs.js@@ -1,7 +1,7 @@import React, { useState, useEffect } from 'react'import Link from 'next/link'-export default function Navbar() {+export default function Navbar({activeCategory}) {return (<nav className="tabs m-none"><ul>@@ -12,32 +12,32 @@ export default function Navbar() {</span></a></li>- <li className="is-active">+ <li className={activeCategory == 'packaged' ? 'is-active': ''}><Link href="/docs/packaged/getting-started"><a className="">Packaged</a></Link></li>- <li>+ <li className={activeCategory == 'admin-api' ? 'is-active': ''}><Link href="/docs/admin-api/getting-started"><a className="">Admin API</a></Link></li>- <li>+ <li className={activeCategory == 'realtime' ? 'is-active': ''}><Link href="/docs/realtime/getting-started"><a className="">Realtime</a></Link></li>- <li>+ <li className={activeCategory == 'rest' ? 'is-active': ''}><Link href="/realtime"><a className="">Rest</a></Link></li>- <li>+ <li className={activeCategory == 'graphql' ? 'is-active': ''}><Link href="/realtime"><a className="">GraphQL</a></Link></li>- <li>+ <li className={activeCategory == 'baseless' ? 'is-active': ''}><Link href="/realtime"><a className="">Baseless</a></Link>diff --git a/packages/web/components/layouts/DocsLayout.js b/packages/web/components/layouts/DocsLayout.jsindex f149121d287..b55acee8f7a 100644--- a/packages/web/components/layouts/DocsLayout.js+++ b/packages/web/components/layouts/DocsLayout.js@@ -5,7 +5,7 @@ import Footer from '../Footer'import Head from 'next/head'export default function DocsLayout(props) {- const { sidebar } = props+ const { sidebar, activeCategory } = propsreturn (<><Head>@@ -13,7 +13,7 @@ export default function DocsLayout(props) {</Head><div className=""><Navbar isFullwidth={true} />- <NavbarDocs />+ <NavbarDocs activeCategory={activeCategory}/><div className="columns m-none is-gapless"><div className="DocsMenuColumn column is-narrow is-hidden-mobile" style={{ width: 250 }}>{Sidebar(sidebar)}@@ -28,7 +28,7 @@ export default function DocsLayout(props) {}const Sidebar = sidebar => {- return Object.entries(sidebar).map(([heading, pages]) => {+ return Object.entries(sidebar || []).map(([heading, pages]) => {return (<><p className="menu-label">{heading}</p>diff --git a/packages/web/pages/docs/[product]/[slug].js b/packages/web/pages/docs/[category]/[slug].jssimilarity index 83%rename from packages/web/pages/docs/[product]/[slug].jsrename to packages/web/pages/docs/[category]/[slug].jsindex 4be0e848afa..dd1d408562c 100644--- a/packages/web/pages/docs/[product]/[slug].js+++ b/packages/web/pages/docs/[category]/[slug].js@@ -28,20 +28,20 @@ Sidebars['realtime'] = {documentation: ['getting-started'],}-export default function ProductDocs() {+export default function CategoryDocs() {const router = useRouter()- let { product, slug } = router.query- if (!product || !slug) return <div></div>+ let { category, slug } = router.query+ if (!category || !slug) return <div></div>- const productDocs = Docs[product]- const productSidebar = enrichSidebar(Sidebars[product], productDocs)- const documentation = productDocs[`./${slug}.mdx`]+ const categoryDocs = Docs[category]+ const categorySidebar = enrichSidebar(Sidebars[category], categoryDocs)+ const documentation = categoryDocs[`./${slug}.mdx`]const Content = documentation.defaultconst { metadata } = documentationconst { title, description } = metadatareturn (- <Layout sidebar={productSidebar} category>+ <Layout sidebar={categorySidebar} activeCategory={category}><div className="has-background-dark"><div className="content w-m-800 p-md p-t-xl p-b-xl"><h1 className="title">{title}</h1>@@ -75,10 +75,10 @@ export default function ProductDocs() {/*** Fills the sidebar array with relevant metadata,*/-const enrichSidebar = (sidebar, productDocs) => {+const enrichSidebar = (sidebar, categoryDocs) => {return Object.keys(sidebar).reduce((acc, heading) => {acc[heading] = sidebar[heading].map(slug => {- const documentation = productDocs[`./${slug}.mdx`]+ const documentation = categoryDocs[`./${slug}.mdx`]const { metadata } = documentationconst { title, sidebarLabel } = metadatareturn { slug, title: sidebarLabel || title }