docs: Add further toggles to content (#38870)

* Implement futher changes for Nimbus

* fixes

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
This commit is contained in:
Chris ChinchillaandCharis Lam authored and GitHub committed 2025-09-19 16:53:20 +00:00
1 parent 10d96127e5
commit 9795b76431
11 files changed
+277 -91

No files matched your search

+6
View File
@@ -1,7 +1,9 @@
import { notFound } from 'next/navigation'
import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { isFeatureEnabled } from 'common'
import { ContributingToc } from '~/app/contributing/ContributingToC'
import { MDXRemoteBase } from '~/features/docs/MdxBase'
import { LayoutMainContent } from '~/layouts/DefaultLayout'
@@ -9,6 +11,10 @@ import { SidebarSkeleton } from '~/layouts/MainSkeleton'
import Breadcrumbs from '~/components/Breadcrumbs'
export default async function ContributingPage() {
if (!isFeatureEnabled('docs:contribution')) {
notFound()
}
const contentFile = join(dirname(fileURLToPath(import.meta.url)), 'content.mdx')
const content = await readFile(contentFile, 'utf-8')
+64 -60
View File
@@ -256,36 +256,37 @@ const HomePage = () => (
})}
</div>
</div>
{isFeatureEnabled('docs:full_getting_started') && (
<div className="flex flex-col lg:grid grid-cols-12 gap-6 py-12 border-b">
<div className="col-span-4 flex flex-col gap-1 [&_h2]:m-0">
<h2 id="migrate-to-supabase" className="group scroll-mt-24">
Migrate to Supabase
</h2>
<p className="text-foreground-light text-sm p-0 m-0">
Bring your existing data, auth and storage to Supabase following our migration guides.
</p>
<TextLink
label="Explore more resources"
url="/guides/resources"
className="no-underline text-brand-link text-sm"
/>
</div>
<div className="flex flex-col lg:grid grid-cols-12 gap-6 py-12 border-b">
<div className="col-span-4 flex flex-col gap-1 [&_h2]:m-0">
<h2 id="migrate-to-supabase" className="group scroll-mt-24">
Migrate to Supabase
</h2>
<p className="text-foreground-light text-sm p-0 m-0">
Bring your existing data, auth and storage to Supabase following our migration guides.
</p>
<TextLink
label="Explore more resources"
url="/guides/resources"
className="no-underline text-brand-link text-sm"
/>
<ul className="grid col-span-8 grid-cols-12 gap-6 not-prose">
{MIGRATION_PAGES.sort((a, b) => (a.name || '').localeCompare(b.name || '')).map(
(guide) => {
return (
<li key={guide.name} className="col-span-6 md:col-span-4">
<Link href={guide.url || '#'} passHref>
<IconPanel {...guide} title={guide.name} background={true} showLink={false} />
</Link>
</li>
)
}
)}
</ul>
</div>
<ul className="grid col-span-8 grid-cols-12 gap-6 not-prose">
{MIGRATION_PAGES.sort((a, b) => (a.name || '').localeCompare(b.name || '')).map(
(guide) => {
return (
<li key={guide.name} className="col-span-6 md:col-span-4">
<Link href={guide.url || '#'} passHref>
<IconPanel {...guide} title={guide.name} background={true} showLink={false} />
</Link>
</li>
)
}
)}
</ul>
</div>
)}
<div className="flex flex-col gap-6 py-12 border-b">
<div className="col-span-4 flex flex-col gap-1 [&_h2]:m-0 [&_h3]:m-0">
@@ -312,41 +313,44 @@ const HomePage = () => (
})}
</ul>
</div>
<div className="flex flex-col lg:grid grid-cols-12 gap-6 py-12">
<div className="col-span-4 flex flex-col gap-1 [&_h2]:m-0 [&_h3]:m-0">
<div className="md:max-w-xs 2xl:max-w-none">
<div className="flex items-center gap-3 mb-3 text-brand-600">
<IconBackground>
<MenuIconPicker icon="self-hosting" width={18} height={18} />
</IconBackground>
<h3 id="self-hosting" className="group scroll-mt-24">
Self-Hosting
</h3>
{isFeatureEnabled('docs:full_getting_started') && (
<div className="flex flex-col lg:grid grid-cols-12 gap-6 py-12">
<div className="col-span-4 flex flex-col gap-1 [&_h2]:m-0 [&_h3]:m-0">
<div className="md:max-w-xs 2xl:max-w-none">
<div className="flex items-center gap-3 mb-3 text-brand-600">
<IconBackground>
<MenuIconPicker icon="self-hosting" width={18} height={18} />
</IconBackground>
<h3 id="self-hosting" className="group scroll-mt-24">
Self-Hosting
</h3>
</div>
<p className="text-foreground-light text-sm">
Get started with self-hosting Supabase.
</p>
<TextLink
label="More on Self-Hosting"
url="/guides/self-hosting"
className="no-underline text-brand-link text-sm"
/>
</div>
<p className="text-foreground-light text-sm">Get started with self-hosting Supabase.</p>
<TextLink
label="More on Self-Hosting"
url="/guides/self-hosting"
className="no-underline text-brand-link text-sm"
/>
</div>
<div className="grid col-span-8 grid-cols-12 gap-6 not-prose">
<ul className="col-span-full lg:col-span-8 grid grid-cols-12 gap-6">
{selfHostingOptions.map((option) => {
return (
<li key={option.title} className="col-span-6">
<Link href={option.href} passHref>
<IconPanelWithIconPicker {...option} background={true} showLink={false} />
</Link>
</li>
)
})}
</ul>
</div>
</div>
<div className="grid col-span-8 grid-cols-12 gap-6 not-prose">
<ul className="col-span-full lg:col-span-8 grid grid-cols-12 gap-6">
{selfHostingOptions.map((option) => {
return (
<li key={option.title} className="col-span-6">
<Link href={option.href} passHref>
<IconPanelWithIconPicker {...option} background={true} showLink={false} />
</Link>
</li>
)
})}
</ul>
</div>
</div>
)}
</div>
</HomeLayout>
)
+5 -3
View File
@@ -148,9 +148,11 @@ const HomePageCover = (props) => {
</p>
</div>
</div>
<div className="w-full xl:max-w-[440px] -mb-40">
<GettingStarted />
</div>
{isFeatureEnabled('docs:full_getting_started') && (
<div className="w-full xl:max-w-[440px] -mb-40">
<GettingStarted />
</div>
)}
</div>
</div>
)
@@ -7,8 +7,16 @@ import type { GlobalMenuItems, NavMenuConstant, NavMenuSection } from '../Naviga
const {
authenticationShowProviders: allAuthProvidersEnabled,
billingAll: billingEnabled,
docsAuth: authEnabled,
docsCompliance: complianceEnabled,
docsContribution: contributionEnabled,
'docsSelf-hosting': selfHostingEnabled,
docsFrameworkQuickstarts: frameworkQuickstartsEnabled,
docsFullPlatform: fullPlatformEnabled,
docsMobileTutorials: mobileTutorialsEnabled,
docsPgtap: pgTapEnabled,
docsProductionChecklist: productionChecklistEnabled,
docsWebApps: webAppsEnabled,
integrationsPartners: integrationsEnabled,
sdkCsharp: sdkCsharpEnabled,
sdkDart: sdkDartEnabled,
@@ -18,8 +26,16 @@ const {
} = isFeatureEnabled([
'authentication:show_providers',
'billing:all',
'docs:auth',
'docs:contribution',
'docs:compliance',
'docs:self-hosting',
'docs:framework_quickstarts',
'docs:full_platform',
'docs:mobile_tutorials',
'docs:pgtap',
'docs:production_checklist',
'docs:web_apps',
'integrations:partners',
'sdk:csharp',
'sdk:dart',
@@ -56,6 +72,7 @@ export const GLOBAL_MENU_ITEMS: GlobalMenuItems = [
icon: 'auth',
href: '/guides/auth' as `/${string}`,
level: 'auth',
enabled: authEnabled,
},
{
label: 'Storage',
@@ -280,6 +297,7 @@ export const GLOBAL_MENU_ITEMS: GlobalMenuItems = [
label: 'Contributing',
icon: 'contributing',
href: '/contributing' as `/${string}`,
enabled: contributionEnabled,
},
],
],
@@ -296,26 +314,39 @@ export const gettingstarted: NavMenuConstant = {
{ name: 'Architecture', url: '/guides/getting-started/architecture' },
{
name: 'Framework Quickstarts',
enabled: frameworkQuickstartsEnabled,
items: [
{ name: 'Next.js', url: '/guides/getting-started/quickstarts/nextjs' },
{ name: 'React', url: '/guides/getting-started/quickstarts/reactjs' },
{ name: 'Nuxt', url: '/guides/getting-started/quickstarts/nuxtjs' },
{ name: 'Vue', url: '/guides/getting-started/quickstarts/vue' },
{ name: 'Hono', url: '/guides/getting-started/quickstarts/hono' },
{
name: 'Next.js',
url: '/guides/getting-started/quickstarts/nextjs',
},
{
name: 'React',
url: '/guides/getting-started/quickstarts/reactjs',
},
{
name: 'Nuxt',
url: '/guides/getting-started/quickstarts/nuxtjs',
},
{
name: 'Vue',
url: '/guides/getting-started/quickstarts/vue',
},
{
name: 'Hono',
url: '/guides/getting-started/quickstarts/hono',
},
{
name: 'Flutter',
url: '/guides/getting-started/quickstarts/flutter',
enabled: sdkDartEnabled,
},
{
name: 'iOS SwiftUI',
url: '/guides/getting-started/quickstarts/ios-swiftui',
enabled: sdkSwiftEnabled,
},
{
name: 'Android Kotlin',
url: '/guides/getting-started/quickstarts/kotlin' as `/${string}`,
enabled: sdkKotlinEnabled,
},
{
name: 'SvelteKit',
@@ -332,16 +363,23 @@ export const gettingstarted: NavMenuConstant = {
enabled: !jsOnly,
},
{ name: 'SolidJS', url: '/guides/getting-started/quickstarts/solidjs' },
{
name: 'SolidJS',
url: '/guides/getting-started/quickstarts/solidjs',
},
{
name: 'RedwoodJS',
url: '/guides/getting-started/quickstarts/redwoodjs' as `/${string}`,
},
{ name: 'refine', url: '/guides/getting-started/quickstarts/refine' },
{
name: 'refine',
url: '/guides/getting-started/quickstarts/refine',
},
],
},
{
name: 'Web app demos',
enabled: webAppsEnabled,
items: [
{
name: 'Next.js',
@@ -387,6 +425,7 @@ export const gettingstarted: NavMenuConstant = {
},
{
name: 'Mobile tutorials',
enabled: mobileTutorialsEnabled,
items: [
{
name: 'Flutter',
@@ -599,6 +638,7 @@ export const PhoneLoginsItems = [
export const auth: NavMenuConstant = {
icon: 'auth',
title: 'Auth',
enabled: authEnabled,
items: [
{
name: 'Overview',
@@ -1514,6 +1554,7 @@ export const functions: NavMenuConstant = {
{
name: 'Limits',
url: '/guides/functions/limits' as `/${string}`,
enabled: billingEnabled,
},
{
name: 'Pricing',
@@ -1713,7 +1754,7 @@ export const realtime: NavMenuConstant = {
name: 'Deep dive',
url: undefined,
items: [
{ name: 'Quotas', url: '/guides/realtime/quotas' },
{ name: 'Quotas', url: '/guides/realtime/quotas', enabled: billingEnabled },
{
name: 'Pricing',
url: '/guides/realtime/pricing' as `/${string}`,
@@ -1784,7 +1825,7 @@ export const storage: NavMenuConstant = {
name: 'S3 Uploads',
url: '/guides/storage/uploads/s3-uploads' as `/${string}`,
},
{ name: 'Limits', url: '/guides/storage/uploads/file-limits' },
{ name: 'Limits', url: '/guides/storage/uploads/file-limits', enabled: billingEnabled },
],
},
{
@@ -1799,6 +1840,7 @@ export const storage: NavMenuConstant = {
{
name: 'Bandwidth & Storage Egress',
url: '/guides/storage/serving/bandwidth' as `/${string}`,
enabled: billingEnabled,
},
],
},
@@ -1839,6 +1881,7 @@ export const storage: NavMenuConstant = {
{
name: 'Limits',
url: '/guides/storage/analytics/limits' as `/${string}`,
enabled: billingEnabled,
},
],
},
@@ -2101,6 +2144,7 @@ export const local_development: NavMenuConstant = {
{
name: 'pgTAP advanced guide',
url: '/guides/local-development/testing/pgtap-extended' as `/${string}`,
enabled: pgTapEnabled,
},
{ name: 'Database testing', url: '/guides/database/testing' },
{
@@ -2116,6 +2160,7 @@ export const contributing: NavMenuConstant = {
icon: 'contributing',
title: 'Contributing',
url: '/contributing',
enabled: contributionEnabled,
items: [{ name: 'Overview', url: '/contributing' }],
}
@@ -2213,7 +2258,11 @@ export const security: NavMenuConstant = {
name: 'Guides',
url: undefined,
items: [
{ name: 'Production Checklist', url: '/guides/deployment/going-into-prod' },
{
name: 'Production Checklist',
url: '/guides/deployment/going-into-prod',
enabled: productionChecklistEnabled,
},
{
name: 'Shared Responsibility Model',
url: '/guides/deployment/shared-responsibility-model' as `/${string}`,
@@ -2243,6 +2292,7 @@ export const platform: NavMenuConstant = {
{
name: 'Upgrades & Migrations',
url: undefined,
enabled: fullPlatformEnabled,
items: [
{ name: 'Upgrading', url: '/guides/platform/upgrading' },
{
@@ -2277,6 +2327,7 @@ export const platform: NavMenuConstant = {
{
name: 'Multi-factor Authentication',
url: '/guides/platform/multi-factor-authentication',
enabled: fullPlatformEnabled,
items: [
{
name: 'Enforce MFA on organization',
@@ -2287,6 +2338,7 @@ export const platform: NavMenuConstant = {
{
name: 'Transfer Project',
url: '/guides/platform/project-transfer' as `/${string}`,
enabled: fullPlatformEnabled,
},
{
name: 'Restore to a new project',
@@ -2295,6 +2347,7 @@ export const platform: NavMenuConstant = {
{
name: 'Single Sign-On',
url: '/guides/platform/sso',
enabled: fullPlatformEnabled,
items: [
{ name: 'SSO with Azure AD', url: '/guides/platform/sso/azure' },
{
@@ -2311,8 +2364,16 @@ export const platform: NavMenuConstant = {
url: undefined,
items: [
{ name: 'Regions', url: '/guides/platform/regions' as `/${string}` },
{ name: 'Compute and Disk', url: '/guides/platform/compute-and-disk' as `/${string}` },
{ name: 'Database Size', url: '/guides/platform/database-size' as `/${string}` },
{
name: 'Compute and Disk',
url: '/guides/platform/compute-and-disk' as `/${string}`,
enabled: fullPlatformEnabled,
},
{
name: 'Database Size',
url: '/guides/platform/database-size' as `/${string}`,
enabled: fullPlatformEnabled,
},
{ name: 'HIPAA Projects', url: '/guides/platform/hipaa-projects' as `/${string}` },
{
name: 'Network Restrictions',
@@ -2611,7 +2672,11 @@ export const deployment: NavMenuConstant = {
url: '/guides/deployment/shared-responsibility-model' as `/${string}`,
},
{ name: 'Maturity model', url: '/guides/deployment/maturity-model' },
{ name: 'Production checklist', url: '/guides/deployment/going-into-prod' },
{
name: 'Production checklist',
url: '/guides/deployment/going-into-prod',
enabled: productionChecklistEnabled,
},
{ name: 'SOC 2 compliance', url: '/guides/security/soc-2-compliance' },
],
},
+15 -9
View File
@@ -101,7 +101,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database, and query the data from a React app.',
icon: '/docs/img/icons/react-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'Next.js',
@@ -110,7 +110,7 @@ hideToc: true
'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Next.js app.',
icon: '/docs/img/icons/nextjs-icon',
hasLightIcon: true,
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'Nuxt',
@@ -118,7 +118,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Nuxt app.',
icon: '/docs/img/icons/nuxt-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'Hono',
@@ -126,7 +126,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database, secure it with auth, and query the data from a Hono app.',
icon: '/docs/img/icons/hono-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'RedwoodJS',
@@ -134,7 +134,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database using Prisma migration and seeds, and query the data from a RedwoodJS app.',
icon: '/docs/img/icons/redwood-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'Flutter',
@@ -166,7 +166,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database, and query the data from a SvelteKit app.',
icon: '/docs/img/icons/svelte-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'SolidJS',
@@ -174,7 +174,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database, and query the data from a SolidJS app.',
icon: '/docs/img/icons/solidjs-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'Vue',
@@ -182,7 +182,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Vue app.',
icon: '/docs/img/icons/vuejs-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
{
title: 'refine',
@@ -190,7 +190,7 @@ hideToc: true
description:
'Learn how to create a Supabase project, add some sample data to your database, and query the data from a refine app.',
icon: '/docs/img/icons/refine-icon',
enabled: true,
enabled: isFeatureEnabled('docs:framework_quickstarts'),
},
]
.filter((item) => item.enabled !== false)
@@ -211,6 +211,8 @@ hideToc: true
})}
</div>
<$Show if="docs:web_apps">
### Web app demos
<div className="grid lg:grid-cols-12 gap-6 not-prose">
@@ -299,6 +301,9 @@ hideToc: true
})}
</div>
</$Show>
<$Show if="docs:mobile_tutorials">
### Mobile tutorials
@@ -389,3 +394,4 @@ hideToc: true
})}
</div>
</$Show>
@@ -24,6 +24,7 @@ npm install @supabase/supabase-js
```
</TabPanel>
<$Show if="sdk:dart">
<TabPanel id="dart" label="Flutter">
```bash
@@ -31,6 +32,8 @@ flutter pub add supabase_flutter
```
</TabPanel>
</$Show>
<$Show if="sdk:swift">
<TabPanel id="swift" label="Swift">
```swift
@@ -58,6 +61,8 @@ let package = Package(
```
</TabPanel>
</$Show>
<$Show if="sdk:python">
<TabPanel id="python" label="Python - PIP">
```bash
@@ -72,6 +77,7 @@ conda install -c conda-forge supabase
```
</TabPanel>
</$Show>
</Tabs>
### 2. Initialize the client
@@ -95,6 +101,7 @@ const supabase = createClient('https://<project>.supabase.co', '<anon_key or sb_
```
</TabPanel>
<$Show if="sdk:dart">
<TabPanel id="dart" label="Flutter">
```dart
@@ -112,6 +119,8 @@ final supabase = Supabase.instance.client;
```
</TabPanel>
</$Show>
<$Show if="sdk:swift">
<TabPanel id="swift" label="Swift">
```swift
@@ -124,6 +133,8 @@ let supabase = SupabaseClient(
```
</TabPanel>
</$Show>
<$Show if="sdk:python">
<TabPanel id="python" label="Python">
```python
@@ -135,6 +146,7 @@ supabase: Client = create_client(url, key)
```
</TabPanel>
</$Show>
</Tabs>
### 3. Create your first Channel
@@ -158,6 +170,7 @@ const channel = supabase.channel('room:lobby:messages', {
```
</TabPanel>
<$Show if="sdk:dart">
<TabPanel id="dart" label="Flutter">
```dart
@@ -166,6 +179,8 @@ final channel = supabase.channel('room:lobby:messages');
```
</TabPanel>
</$Show>
<$Show if="sdk:swift">
<TabPanel id="swift" label="Swift">
```swift
@@ -176,6 +191,8 @@ let channel = supabase.channel("room:lobby:messages") {
```
</TabPanel>
</$Show>
<$Show if="sdk:python">
<TabPanel id="python" label="Python">
```python
@@ -184,6 +201,7 @@ channel = supabase.channel('room:lobby:messages', params={config={private= True
```
</TabPanel>
</$Show>
</Tabs>
### 4. Set up authorization
@@ -238,6 +256,7 @@ channel.send({
```
</TabPanel>
<$Show if="sdk:dart">
<TabPanel id="dart" label="Flutter">
```dart
@@ -261,6 +280,8 @@ channel.sendBroadcastMessage(
```
</TabPanel>
</$Show>
<$Show if="sdk:swift">
<TabPanel id="swift" label="Swift">
```swift
@@ -283,6 +304,8 @@ await channel.sendBroadcastMessage(
```
</TabPanel>
</$Show>
<$Show if="sdk:python">
<TabPanel id="python" label="Python">
```python
@@ -304,6 +327,7 @@ channel.send_broadcast_message(
```
</TabPanel>
</$Show>
</Tabs>
#### 5.2 using HTTP/REST API
@@ -342,6 +366,7 @@ const response = await fetch(`https://<project>.supabase.co/rest/v1/rpc/broadcas
```
</TabPanel>
<$Show if="sdk:dart">
<TabPanel id="dart" label="Flutter">
```dart
@@ -370,6 +395,8 @@ final response = await http.post(
```
</TabPanel>
</$Show>
<$Show if="sdk:swift">
<TabPanel id="swift" label="Swift">
```swift
@@ -400,6 +427,8 @@ let (data, response) = try await URLSession.shared.data(for: request)
```
</TabPanel>
</$Show>
<$Show if="sdk:python">
<TabPanel id="python" label="Python">
```python
@@ -428,6 +457,7 @@ response = requests.post(
```
</TabPanel>
</$Show>
</Tabs>
#### 5.3 using database triggers
@@ -543,6 +573,7 @@ useEffect(() => {
```
</TabPanel>
<$Show if="sdk:dart">
<TabPanel id="dart" label="Flutter">
```dart
@@ -565,6 +596,8 @@ class _MyWidgetState extends State<MyWidget> {
```
</TabPanel>
</$Show>
<$Show if="sdk:swift">
<TabPanel id="swift" label="Swift">
```swift
@@ -587,6 +620,8 @@ struct ContentView: View {
```
</TabPanel>
</$Show>
<$Show if="sdk:python">
<TabPanel id="python" label="Python">
```python
@@ -610,6 +645,7 @@ with RealtimeManager() as channel:
```
</TabPanel>
</$Show>
</Tabs>
## Choose the right feature
@@ -29,6 +29,8 @@ Reports can be filtered by time range to focus your analysis on specific periods
---
<$Show if="billing:all">
## Database
The Database report provides the most comprehensive view into your Postgres instance's health and performance characteristics. These charts help you identify performance bottlenecks, resource constraints, and optimization opportunities at a glance.
@@ -44,6 +46,8 @@ The following charts are available for Free and Pro plans:
| Shared Pooler connections | All | Client connections to the shared pooler | Shared pooler usage patterns |
| Dedicated Pooler connections | All | Client connections to PgBouncer | Dedicated pooler connection monitoring |
</$Show>
{/* supa-mdx-lint-disable-next-line Rule001HeadingCase */}
### Advanced Telemetry
@@ -1,3 +1,4 @@
import { isFeatureEnabled } from 'common'
import { Fragment, type PropsWithChildren } from 'react'
import { cn } from 'ui'
@@ -29,6 +30,8 @@ export async function ReferenceNavigation({
isLatestVersion,
}: ReferenceNavigationProps) {
const navSections = await getReferenceSections(libraryId, version)
const filteredNavSections = navSections?.filter((section) => section.title !== 'Auth')
const displayedNavSections = isFeatureEnabled('docs:auth') ? navSections : filteredNavSections
const basePath = `/reference/${libPath}${isLatestVersion ? '' : `/${version}`}`
@@ -40,7 +43,7 @@ export async function ReferenceNavigation({
<RefVersionDropdown library={libPath} currentVersion={version} />
</div>
<ul className="flex flex-col gap-2">
{navSections?.map((section) => (
{displayedNavSections?.map((section) => (
<Fragment key={section.id}>
{section.type === 'category' ? (
<li>
@@ -2,6 +2,7 @@ import { Fragment } from 'react'
import ReactMarkdown from 'react-markdown'
import { Tabs_Shadcn_, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_, cn } from 'ui'
import { isFeatureEnabled } from 'common'
import ApiSchema from '~/components/ApiSchema'
import { REFERENCES } from '~/content/navigation.references'
import { MDXRemoteRefs, getRefMarkdown } from '~/features/docs/Reference.mdx'
@@ -42,6 +43,13 @@ async function RefSections({ libraryId, version }: RefSectionsProps) {
flattenedSections = trimIntro(flattenedSections)
}
if (!isFeatureEnabled('docs:auth')) {
flattenedSections = flattenedSections?.filter(
(section) =>
'product' in section && section.product !== 'auth' && section.product !== 'auth-admin'
)
}
return (
<div className="flex flex-col my-16 gap-16">
{(flattenedSections || [])
@@ -33,8 +33,17 @@
"database:replication": true,
"database:roles": true,
"docs:auth": true,
"docs:compliance": true,
"docs:contribution": true,
"docs:self-hosting": true,
"docs:framework_quickstarts": true,
"docs:full_getting_started": true,
"docs:full_platform": true,
"docs:mobile_tutorials": true,
"docs:pgtap": true,
"docs:production_checklist": true,
"docs:web_apps": true,
"feedback:docs": true,
@@ -115,7 +115,14 @@
"type": "boolean",
"description": "Enable the database roles page"
},
"docs:auth": {
"type": "boolean",
"description": "Enable auth docs"
},
"docs:contribution": {
"type": "boolean",
"description": "Enable documentation on contribution"
},
"docs:compliance": {
"type": "boolean",
"description": "Enable documentation on compliance"
@@ -124,7 +131,34 @@
"type": "boolean",
"description": "Enable documentation for self-hosting"
},
"docs:framework_quickstarts": {
"type": "boolean",
"description": "Enable framework quickstarts documentation"
},
"docs:full_getting_started": {
"type": "boolean",
"description": "Enable full getting started documentation"
},
"docs:full_platform": {
"type": "boolean",
"description": "Enable full platform documentation"
},
"docs:mobile_tutorials": {
"type": "boolean",
"description": "Enable mobile tutorials getting started documentation"
},
"docs:pgtap": {
"type": "boolean",
"description": "Enable pgtap started documentation"
},
"docs:production_checklist": {
"type": "boolean",
"description": "Enable production checklist"
},
"docs:web_apps": {
"type": "boolean",
"description": "Enable web apps getting started documentation"
},
"feedback:docs": {
"type": "boolean",
"description": "Enable feedback submission for docs site"
@@ -292,8 +326,17 @@
"dashboard_auth:sign_in_with_email",
"database:replication",
"database:roles",
"docs:auth",
"docs:compliance",
"docs:contribution",
"docs:framework_quickstarts",
"docs:full_getting_started",
"docs:full_platform",
"docs:mobile_tutorials",
"docs:pgtap",
"docs:production_checklist",
"docs:self-hosting",
"docs:web_apps",
"feedback:docs",
"integrations:partners",
"integrations:show_stripe_wrapper",