Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(docs): markdown rendering in self hosted config docs

Greg Richardsonb7ce59a567ba
diff --git a/apps/docs/pages/guides/self-hosting/analytics/config.mdx b/apps/docs/pages/guides/self-hosting/analytics/config.mdx
index 8267f6a913e..97dc3bf3a97 100644
--- a/apps/docs/pages/guides/self-hosting/analytics/config.mdx
+++ b/apps/docs/pages/guides/self-hosting/analytics/config.mdx
@@ -1,18 +1,19 @@
import Layout from '~/layouts/DefaultGuideLayout'
import { getAnalyticsConfigV0 } from '~/lib/mdx/getConfig'
import Param from '~/components/Params'
-
-export const spec = getAnalyticsConfigV0()
+import { serialize } from 'next-mdx-remote/serialize'
+import components from '~/components'
+import { MDXRemote } from 'next-mdx-remote'
export const meta = {
title: 'Analytics Self-hosting Config',
description: 'How to configure and deploy Supabase Analytics.',
}
-<div>{spec.info.description}</div>
+<MDXRemote {...props.descriptionSource} components={components} />
<div>
-{spec.info.tags.map(tag => {
+{props.spec.info.tags.map(tag => {
return (
<>
<h2 className="text-scale-1200">{tag.title}</h2>
@@ -20,7 +21,7 @@ export const meta = {
<div className="not-prose">
<h5 className="text-base text-scale-1200 mb-3">Parameters</h5>
<ul>
- {spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
+ {props.spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
return <Param name={param.title} type={param.type} description={param.description} required={param.required} />
})}
@@ -36,3 +37,14 @@ export const meta = {
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
+
+export const getStaticProps = async () => {
+ const spec = getAnalyticsConfigV0()
+ const descriptionSource = await serialize(spec.info.description)
+ return {
+ props: {
+ descriptionSource,
+ spec,
+ },
+ }
+}
diff --git a/apps/docs/pages/guides/self-hosting/auth/config.mdx b/apps/docs/pages/guides/self-hosting/auth/config.mdx
index 0e894114c65..e62b9746ad9 100644
--- a/apps/docs/pages/guides/self-hosting/auth/config.mdx
+++ b/apps/docs/pages/guides/self-hosting/auth/config.mdx
@@ -1,18 +1,19 @@
import Layout from '~/layouts/DefaultGuideLayout'
import { getAuthConfigV1 } from '~/lib/mdx/getConfig'
import Param from '~/components/Params'
-
-export const spec = getAuthConfigV1()
+import { serialize } from 'next-mdx-remote/serialize'
+import components from '~/components'
+import { MDXRemote } from 'next-mdx-remote'
export const meta = {
title: 'Auth Self-hosting Config',
description: 'How to configure and deploy Supabase.',
}
-<div>{spec.info.description}</div>
+<MDXRemote {...props.descriptionSource} components={components} />
<div>
-{spec.info.tags.map(tag => {
+{props.spec.info.tags.map(tag => {
return (
<>
<h2 className="text-scale-1200">{tag.title}</h2>
@@ -20,7 +21,7 @@ export const meta = {
<div className="not-prose">
<h5 className="text-base text-scale-1200 mb-3">Parameters</h5>
<ul>
- {spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
+ {props.spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
return <Param name={param.title} type={param.type} description={param.description} required={param.required} />
})}
@@ -36,3 +37,14 @@ export const meta = {
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
+
+export const getStaticProps = async () => {
+ const spec = getAuthConfigV1()
+ const descriptionSource = await serialize(spec.info.description)
+ return {
+ props: {
+ descriptionSource,
+ spec,
+ },
+ }
+}
diff --git a/apps/docs/pages/guides/self-hosting/realtime/config.mdx b/apps/docs/pages/guides/self-hosting/realtime/config.mdx
index f576951b201..d960852fe5d 100644
--- a/apps/docs/pages/guides/self-hosting/realtime/config.mdx
+++ b/apps/docs/pages/guides/self-hosting/realtime/config.mdx
@@ -1,20 +1,21 @@
import Layout from '~/layouts/DefaultGuideLayout'
import { getRealtimeConfigV0 } from '~/lib/mdx/getConfig'
import Param from '~/components/Params'
-
-export const spec = getRealtimeConfigV0()
+import { serialize } from 'next-mdx-remote/serialize'
+import components from '~/components'
+import { MDXRemote } from 'next-mdx-remote'
export const meta = {
title: 'Realtime Self-hosting Config',
description: 'How to configure and deploy Supabase.',
}
-<div>{spec.info.description}</div>
+<MDXRemote {...props.descriptionSource} components={components} />
See [this guide](/docs/guides/realtime/bring-your-own-database) if you want to configure your database to work with Realtime.
<div>
-{spec.info.tags.map(tag => {
+{props.spec.info.tags.map(tag => {
return (
<>
<h2 className="text-scale-1200">{tag.title}</h2>
@@ -22,7 +23,7 @@ See [this guide](/docs/guides/realtime/bring-your-own-database) if you want to c
<div className="not-prose">
<h5 className="text-base text-scale-1200 mb-3">Parameters</h5>
<ul>
- {spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
+ {props.spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
return <Param name={param.title} type={param.type} description={param.description} required={param.required} />
})}
@@ -38,3 +39,14 @@ See [this guide](/docs/guides/realtime/bring-your-own-database) if you want to c
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
+
+export const getStaticProps = async () => {
+ const spec = getRealtimeConfigV0()
+ const descriptionSource = await serialize(spec.info.description)
+ return {
+ props: {
+ descriptionSource,
+ spec,
+ },
+ }
+}
diff --git a/apps/docs/pages/guides/self-hosting/storage/config.mdx b/apps/docs/pages/guides/self-hosting/storage/config.mdx
index c6d637300b2..76f04369ad5 100644
--- a/apps/docs/pages/guides/self-hosting/storage/config.mdx
+++ b/apps/docs/pages/guides/self-hosting/storage/config.mdx
@@ -1,20 +1,19 @@
import Layout from '~/layouts/DefaultGuideLayout'
import { getStorageConfigV0 } from '~/lib/mdx/getConfig'
import Param from '~/components/Params'
-
-export const spec = getStorageConfigV0()
+import { serialize } from 'next-mdx-remote/serialize'
+import components from '~/components'
+import { MDXRemote } from 'next-mdx-remote'
export const meta = {
title: 'Storage Self-hosting Config',
description: 'How to configure and deploy Supabase.',
}
-A sample `.env` file is located in the [storage repository](https://github.com/supabase/storage-api/blob/master/.env.sample).
-
-<div>{spec.info.description}</div>
+<MDXRemote {...props.descriptionSource} components={components} />
<div>
-{spec.info.tags.map(tag => {
+{props.spec.info.tags.map(tag => {
return (
<>
<h2 className="text-scale-1200">{tag.title}</h2>
@@ -22,7 +21,7 @@ A sample `.env` file is located in the [storage repository](https://github.com/s
<div className="not-prose">
<h5 className="text-base text-scale-1200 mb-3">Parameters</h5>
<ul>
- {spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
+ {props.spec.parameters.filter(param => param.tags.includes(tag.id)).map((param) => {
return <Param name={param.title} type={param.type} description={param.description} required={param.required} />
})}
@@ -38,3 +37,14 @@ A sample `.env` file is located in the [storage repository](https://github.com/s
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
+
+export const getStaticProps = async () => {
+ const spec = getStorageConfigV0()
+ const descriptionSource = await serialize(spec.info.description)
+ return {
+ props: {
+ descriptionSource,
+ spec,
+ },
+ }
+}
diff --git a/spec/storage_v0_config.yaml b/spec/storage_v0_config.yaml
index c39b7073fe1..fd45b2d862f 100644
--- a/spec/storage_v0_config.yaml
+++ b/spec/storage_v0_config.yaml
@@ -9,6 +9,8 @@ info:
bugs: 'https://github.com/supabase/storage-api/issues' # {string} Where developers can file bugs.
spec: 'https://github.com/supabase/supabase/blob/master/spec/storage_v1_config.yml' # {string} Where developers can find this spec (to link directly in the docs).
description: |
+ A sample `.env` file is located in the [storage repository](https://github.com/supabase/storage-api/blob/master/.env.sample).
+
Use this file to configure your environment variables for your Storage server.
tags:
- id: general