Skip to content

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

Add Postgres Resources section to menu

Terry Suttonf2a9aec58ab4
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index c55fd5fc084..39ae9d278cd 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -610,6 +610,38 @@ export const resources = {
},
],
},
+ {
+ name: 'Postgres resources',
+ url: undefined,
+ items: [
+ { name: 'Basics', url: '/guides/resources/postgres' },
+ { name: 'Managing Postgres Databases', url: '/' },
+ { name: 'RLS Policies', url: '/' },
+ { name: '...', url: '/' },
+ {
+ name: 'Child 1',
+ url: '/guides/resources/postgres/child1',
+ items: [
+ {
+ name: 'grandchild1',
+ url: '/guides/resources/postgres/child1/grandchild1',
+ items: [],
+ },
+ ],
+ },
+ {
+ name: 'Child 2',
+ url: '/guides/resources/postgres/child2',
+ items: [
+ {
+ name: 'grandchild2',
+ url: '/guides/resources/postgres/child2/grandchild2',
+ items: [],
+ },
+ ],
+ },
+ ],
+ },
],
}
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsx
index b0a5a9c78e1..7e52d424832 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsx
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuGuideList.tsx
@@ -12,8 +12,17 @@ const NavigationMenuGuideList: React.FC<Props> = ({ id, active }) => {
// get url
const url = router.asPath
- // remove the end of the url if a deep link
- const firstLevelRoute = url?.split('/')?.slice(0, 4)?.join('/')
+
+ // We need to decide how deep we want the menu to be for matching urls
+ // if the links are really deep, we don't want to match all the way out
+ // But we need to reach out further to make the structure of /resources/postgres/ work
+ // look at /resources/postgres/ vs /auth/phone-login for how these are different
+ let firstLevelRoute
+ if (url.includes('resources/postgres/')) {
+ firstLevelRoute = url?.split('/')?.slice(0, 5)?.join('/')
+ } else {
+ firstLevelRoute = url?.split('/')?.slice(0, 4)?.join('/')
+ }
return (
<Accordion.Root