docs: Further toggles for Nimbus project (#39010)

chore: feature flag footer and fdw section

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
This commit is contained in:
Chris Chinchilla
2025-09-25 16:26:46 +02:00
committed by GitHub
parent 32d130436d
commit e01699cce5
5 changed files with 42 additions and 14 deletions

View File

@@ -1,28 +1,30 @@
import matter from 'gray-matter'
import Link from 'next/link'
import { notFound } from 'next/navigation'
import { readFile } from 'node:fs/promises'
import { join, relative } from 'node:path'
import rehypeSlug from 'rehype-slug'
import emoji from 'remark-emoji'
import Link from 'next/link'
// End of third-party imports
import { IS_PROD, isFeatureEnabled } from 'common'
import { Button } from 'ui'
import { Admonition } from 'ui-patterns'
import { Guide, GuideArticle, GuideHeader, GuideFooter, GuideMdxContent } from '~/features/ui/guide'
import { newEditLink } from '~/features/helpers.edit-link'
import {
genGuideMeta,
genGuidesStaticParams,
removeRedundantH1,
} from '~/features/docs/GuidesMdx.utils'
import { newEditLink } from '~/features/helpers.edit-link'
import { REVALIDATION_TAGS } from '~/features/helpers.fetch'
import { Guide, GuideArticle, GuideFooter, GuideHeader, GuideMdxContent } from '~/features/ui/guide'
import { GUIDES_DIRECTORY, isValidGuideFrontmatter } from '~/lib/docs'
import { UrlTransformFunction, linkTransform } from '~/lib/mdx/plugins/rehypeLinkTransform'
import { linkTransform, type UrlTransformFunction } from '~/lib/mdx/plugins/rehypeLinkTransform'
import remarkMkDocsAdmonition from '~/lib/mdx/plugins/remarkAdmonition'
import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle'
import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs'
import { octokit } from '~/lib/octokit'
import { SerializeOptions } from '~/types/next-mdx-remote-serialize'
import { IS_PROD } from 'common'
import type { SerializeOptions } from '~/types/next-mdx-remote-serialize'
// We fetch these docs at build time from an external repo
const org = 'supabase'
@@ -85,7 +87,10 @@ async function getLatestRelease(after: string | null = null) {
after,
request: {
fetch: (url: RequestInfo | URL, options?: RequestInit) =>
fetch(url, { ...options, next: { tags: [REVALIDATION_TAGS.WRAPPERS] } }),
fetch(url, {
...options,
next: { tags: [REVALIDATION_TAGS.WRAPPERS] },
}),
},
})
@@ -243,6 +248,10 @@ interface Params {
}
const WrappersDocs = async (props: { params: Promise<Params> }) => {
if (!isFeatureEnabled('docs:fdw')) {
notFound()
}
const params = await props.params
const { isExternal, meta, assetsBaseUrl, ...data } = await getContent(params)

View File

@@ -1,4 +1,5 @@
import type { ComponentProps } from 'react'
// End of third-party imports
import { isFeatureEnabled } from 'common/enabled-features'
import type { IconPanel } from 'ui-patterns/IconPanel'
@@ -14,13 +15,14 @@ const {
docsAuthTroubleshooting: authTroubleshootingEnabled,
docsCompliance: complianceEnabled,
docsContribution: contributionEnabled,
'docsSelf-hosting': selfHostingEnabled,
docsFdw: fdwEnabled,
docsFrameworkQuickstarts: frameworkQuickstartsEnabled,
docsFullPlatform: fullPlatformEnabled,
docsLocalDevelopment: localDevelopmentEnabled,
docsMobileTutorials: mobileTutorialsEnabled,
docsPgtap: pgTapEnabled,
docsProductionChecklist: productionChecklistEnabled,
'docsSelf-hosting': selfHostingEnabled,
docsWebApps: webAppsEnabled,
integrationsPartners: integrationsEnabled,
sdkCsharp: sdkCsharpEnabled,
@@ -38,6 +40,7 @@ const {
'docs:auth_troubleshooting',
'docs:compliance',
'docs:contribution',
'docs:fdw',
'docs:self-hosting',
'docs:framework_quickstarts',
'docs:full_platform',
@@ -1260,6 +1263,7 @@ export const database: NavMenuConstant = {
{
name: 'Foreign Data Wrappers',
url: undefined,
enabled: fdwEnabled,
items: [
{
name: 'Overview',

View File

@@ -2,13 +2,14 @@
import dynamic from 'next/dynamic'
import { usePathname } from 'next/navigation'
import { memo, useEffect, type PropsWithChildren, type ReactNode } from 'react'
import { memo, type PropsWithChildren, type ReactNode, useEffect } from 'react'
// End of third-party imports
import { isFeatureEnabled } from 'common'
import { cn } from 'ui'
import { type NavMenuSection } from '~/components/Navigation/Navigation.types'
import type { NavMenuSection } from '~/components/Navigation/Navigation.types'
import DefaultNavigationMenu, {
MenuId,
type MenuId,
} from '~/components/Navigation/NavigationMenu/NavigationMenu'
import { getMenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu.utils'
import TopNavBar from '~/components/Navigation/NavigationMenu/TopNavBar'
@@ -17,6 +18,8 @@ import { menuState, useMenuMobileOpen } from '~/hooks/useMenuState'
const Footer = dynamic(() => import('~/components/Navigation/Footer'))
const footerEnabled = isFeatureEnabled('docs:footer')
const levelsData = {
home: {
icon: 'home',
@@ -375,7 +378,7 @@ function SidebarSkeleton({
menuId: _menuId,
menuName,
NavigationMenu,
hideFooter = false,
hideFooter = !footerEnabled,
className,
hideSideNav,
additionalNavItems,

View File

@@ -40,6 +40,8 @@
"docs:auth_troubleshooting": true,
"docs:compliance": true,
"docs:contribution": true,
"docs:fdw": true,
"docs:footer": true,
"docs:self-hosting": true,
"docs:framework_quickstarts": true,
"docs:full_getting_started": true,

View File

@@ -144,6 +144,14 @@
"type": "boolean",
"description": "Enable documentation on contribution"
},
"docs:fdw": {
"type": "boolean",
"description": "Enable documentation on foreign data wrappers"
},
"docs:footer": {
"type": "boolean",
"description": "Enable footer on docs site"
},
"docs:framework_quickstarts": {
"type": "boolean",
"description": "Enable framework quickstarts documentation"
@@ -373,6 +381,8 @@
"docs:auth_troubleshooting",
"docs:compliance",
"docs:contribution",
"docs:fdw",
"docs:footer",
"docs:framework_quickstarts",
"docs:full_getting_started",
"docs:full_platform",