diff --git a/apps/docs/components/NavData.tsx b/apps/docs/components/NavData.tsx deleted file mode 100644 index 8fb29b5fa23..00000000000 --- a/apps/docs/components/NavData.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { ReactNode } from 'react' - -import { navDataForMdx } from './Navigation/NavigationMenu/NavigationMenu.constants' - -export function NavData({ - data, - children, -}: { - data: keyof typeof navDataForMdx - children: (navItems: (typeof navDataForMdx)[keyof typeof navDataForMdx]) => ReactNode -}) { - const navItems = navDataForMdx[data] - return children(navItems) -} diff --git a/apps/docs/content/guides/auth/social-login.mdx b/apps/docs/content/guides/auth/social-login.mdx index c0b642296d3..c5c805bd3bd 100644 --- a/apps/docs/content/guides/auth/social-login.mdx +++ b/apps/docs/content/guides/auth/social-login.mdx @@ -21,28 +21,145 @@ There are several reasons why you might want to add social login to your applica Supabase supports a suite of social providers. Follow these guides to configure a social provider for your platform.
- - {(data) => - data.map((item) => ( - - - {item.description} - - - )) - } - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/apps/docs/content/guides/database/connecting-to-postgres.mdx b/apps/docs/content/guides/database/connecting-to-postgres.mdx index b1ee6e35da7..28e777857e1 100644 --- a/apps/docs/content/guides/database/connecting-to-postgres.mdx +++ b/apps/docs/content/guides/database/connecting-to-postgres.mdx @@ -32,32 +32,54 @@ The IPv4 add-on is not dual-stack: enabling it swaps the project's IPv6 (AAAA) D ## Quickstarts
- - {(data) => - data.items?.map((quickstart) => ( - - - - )) - } - - - {(data) => - data.items?.map((quickstart) => ( - - - - )) - } - + + + + + + + + + + + + + + + + + + + + + + + +
## Data APIs and client libraries diff --git a/apps/docs/content/guides/platform/migrating-to-supabase.mdx b/apps/docs/content/guides/platform/migrating-to-supabase.mdx index f4715f672cf..8b137e228dd 100644 --- a/apps/docs/content/guides/platform/migrating-to-supabase.mdx +++ b/apps/docs/content/guides/platform/migrating-to-supabase.mdx @@ -6,20 +6,104 @@ Learn how to migrate to Supabase from another database service. ## Migration guides - - {(migrationPages) => ( -
- {migrationPages.map((page) => ( - - - - ))} -
- )} -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/apps/docs/features/docs/MdxBase.shared.tsx b/apps/docs/features/docs/MdxBase.shared.tsx index 591a8bf20cb..8a0bc81355c 100644 --- a/apps/docs/features/docs/MdxBase.shared.tsx +++ b/apps/docs/features/docs/MdxBase.shared.tsx @@ -10,7 +10,6 @@ import { Extensions } from '~/components/Extensions' import Image, { type ImageProps } from '~/components/Image' import { Mermaid } from '~/components/Mermaid' import { MetricsStackCards } from '~/components/MetricsStackCards' -import { NavData } from '~/components/NavData' import { Price } from '~/components/Price' import { ProjectConfigVariables } from '~/components/ProjectConfigVariables' import { RealtimeLimitsEstimator } from '~/components/RealtimeLimitsEstimator' @@ -89,7 +88,6 @@ const components = { Mermaid, MetricsStackCards, NamedCodeBlock, - NavData, ProjectConfigVariables, RealtimeLimitsEstimator, RegionsList, diff --git a/apps/docs/internals/generate-guides-markdown.ts b/apps/docs/internals/generate-guides-markdown.ts index b1c037af577..c2601ec237b 100644 --- a/apps/docs/internals/generate-guides-markdown.ts +++ b/apps/docs/internals/generate-guides-markdown.ts @@ -245,40 +245,55 @@ function convertLinkPanels(content: string): string { if (!hrefMatch) return full const href = withDocsBasePath(hrefMatch[1]) - const panelOpen = body.match(/<(GlassPanel|IconPanel)\b/) - if (!panelOpen) return full - const panelName = panelOpen[1] - const panelStart = panelOpen.index ?? 0 + const panelOpen = body.match(/<(GlassPanel|IconPanel)\b/) + if (!panelOpen) return full + const panelName = panelOpen[1] + const panelStart = panelOpen.index ?? 0 - // Walk past the opening tag, respecting JSX expression braces so attribute - // values like `title={...}` don't terminate parsing early. - let i = panelStart + panelOpen[0].length - let depth = 0 - while (i < body.length) { - const ch = body[i] - if (ch === '{') depth++ - else if (ch === '}') depth-- - else if (ch === '>' && depth === 0) break - i++ + // Walk past the opening tag, respecting both JSX `{}` expression depth + // (so `title={...}` doesn't terminate early) and quoted + // attribute values (so `>` inside `className="[&>div]..."` is ignored). + let i = panelStart + panelOpen[0].length + let depth = 0 + let quote: string | null = null + while (i < body.length) { + const ch = body[i] + if (quote) { + if (ch === quote) quote = null + } else if (ch === '"' || ch === "'") { + quote = ch + } else if (ch === '{') { + depth++ + } else if (ch === '}') { + depth-- + } else if (ch === '>' && depth === 0) { + break + } + i++ + } + if (i >= body.length) return full + + const panelAttrs = body.slice(panelStart + panelOpen[0].length, i) + const title = extractTitleAttr(panelAttrs) + if (!title) return full + + // Self-closing panels (``) carry no description. + const isSelfClosing = panelAttrs.trimEnd().endsWith('/') + let description = '' + if (!isSelfClosing) { + const closingTag = `` + const closeIdx = body.indexOf(closingTag, i) + if (closeIdx === -1) return full + description = body + .slice(i + 1, closeIdx) + .replace(/<[^>]+>/g, ' ') + .replace(/\s+/g, ' ') + .trim() + } + + return `- [${title}](${href})${description ? `. ${description}` : ''}` } - if (i >= body.length) return full - - const panelAttrs = body.slice(panelStart + panelOpen[0].length, i) - const closingTag = `` - const closeIdx = body.indexOf(closingTag, i) - if (closeIdx === -1) return full - - const title = extractTitleAttr(panelAttrs) - if (!title) return full - - const description = body - .slice(i + 1, closeIdx) - .replace(/<[^>]+>/g, ' ') - .replace(/\s+/g, ' ') - .trim() - - return `- [${title}](${href})${description ? `. ${description}` : ''}` - }) + ) } /**