diff --git a/mdx/rehype.mjs b/mdx/rehype.mjs
index b137262d..9c93cab1 100644
--- a/mdx/rehype.mjs
+++ b/mdx/rehype.mjs
@@ -101,7 +101,8 @@ function getSections(node) {
sections.push(`{
title: ${JSON.stringify(toString(child))},
id: ${JSON.stringify(child.properties.id)},
- tagName: ${JSON.stringify(child.tagName)},
+ tagName: ${JSON.stringify(child.tagName)},
+ tag: ${JSON.stringify(child.tag)},
...${child.properties.annotation}
}`)
} else if (child.children) {
diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx
index debd880d..7c8ab45a 100644
--- a/src/components/Footer.jsx
+++ b/src/components/Footer.jsx
@@ -4,7 +4,8 @@ import { useRouter } from 'next/router'
import { Transition } from '@headlessui/react'
import { Button } from '@/components/Button'
-import {apiNavigation, docsNavigation, navigation} from '@/components/NavigationAPI'
+import {apiNavigation} from '@/components/NavigationAPI'
+import {docsNavigation} from "@/components/NavigationDocs";
function CheckIcon(props) {
return (
diff --git a/src/components/LayoutDocs.jsx b/src/components/LayoutDocs.jsx
index 9f8ba6bb..9eecfc09 100644
--- a/src/components/LayoutDocs.jsx
+++ b/src/components/LayoutDocs.jsx
@@ -79,50 +79,6 @@ function GitHubIcon(props) {
)
}
-// function Header({ navigation }) {
-// let [isScrolled, setIsScrolled] = useState(false)
-//
-// useEffect(() => {
-// function onScroll() {
-// setIsScrolled(window.scrollY > 0)
-// }
-// onScroll()
-// window.addEventListener('scroll', onScroll, { passive: true })
-// return () => {
-// window.removeEventListener('scroll', onScroll)
-// }
-// }, [])
-//
-// return (
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-// )
-// }
-
function useTableOfContents(tableOfContents) {
let [currentSection, setCurrentSection] = useState(tableOfContents[0]?.id)
@@ -176,7 +132,11 @@ export function LayoutDocs({ children, title, tableOfContents }) {
let section = navigation.find((section) =>
section.links.find((link) => link.href === router.pathname)
)
- let currentSection = useTableOfContents(tableOfContents)
+
+ let currentSection
+ if(!router.route.startsWith("/ipa")) {
+ currentSection = useTableOfContents(tableOfContents)
+ }
function isActive(section) {
if (section.id === currentSection) {
@@ -205,7 +165,8 @@ export function LayoutDocs({ children, title, tableOfContents }) {
-
+ {router.route.startsWith("/ipa") ? :
+ }
@@ -214,7 +175,7 @@ export function LayoutDocs({ children, title, tableOfContents }) {
-
+ {!router.route.startsWith("/ipa/resources") &&
{tableOfContents.length > 0 && (
<>
@@ -266,7 +227,7 @@ export function LayoutDocs({ children, title, tableOfContents }) {
>
)}
-
+
}
>
)
diff --git a/src/components/NavigationAPI.jsx b/src/components/NavigationAPI.jsx
index ff677bd1..dc57bf78 100644
--- a/src/components/NavigationAPI.jsx
+++ b/src/components/NavigationAPI.jsx
@@ -105,15 +105,16 @@ export function ActivePageMarker({ group, pathname }) {
)
}
-function NavigationGroup({ group, className }) {
+function NavigationGroup({ group, className, tableOfContents }) {
// If this is the mobile navigation then we always render the initial
// state, so that the state does not change during the close animation.
// The state will still update when we re-open (re-render) the navigation.
- let isInsideMobileNavigation = useIsInsideMobileNavigation()
- let [router, sections] = useInitialValue(
- [useRouter(), useSectionStore((s) => s.sections)],
- isInsideMobileNavigation
- )
+ // let isInsideMobileNavigation = useIsInsideMobileNavigation()
+ let router = useRouter()
+ // let [router, sections] = useInitialValue(
+ // [useRouter(), useSectionStore((s) => s.sections)],
+ // isInsideMobileNavigation
+ // )
let isActiveGroup =
group.links.findIndex((link) => link.href === router.pathname) !== -1
@@ -127,11 +128,11 @@ function NavigationGroup({ group, className }) {
{group.title}
-
- {isActiveGroup && (
-
- )}
-
+ {/*
*/}
+ {/* {isActiveGroup && (*/}
+ {/* */}
+ {/* )}*/}
+ {/* */}
{link.title}
-
- {link.href === router.pathname && sections.length > 0 && (
+ {/**/}
+ {link.href === router.pathname && (
- {sections.map((section) => (
+ {console.log(tableOfContents.tableOfContents)}
+ {tableOfContents.tableOfContents.map((section) => (
)}
-
+ {/* */}
))}
@@ -183,73 +185,35 @@ function NavigationGroup({ group, className }) {
)
}
-export const docsNavigation = [
- {
- title: 'About NetBird',
- links: [
- { title: 'Why Wireguard with NetBird?', href: '/docs/about-netbird/why-wireguard-with-netbird' },
- { title: 'How Netbird Works', href: '/docs/about-netbird/how-netbird-works' },
- { title: 'NetBird vs. Traditional VPN', href: '/docs/about-netbird/netbird-vs-traditional-vpn' },
- { title: 'Other', href: '/docs/about-netbird/other' },
- { title: 'FAQ', href: '/docs/about-netbird/faq' },
- ],
- },
- {
- title: 'How-to',
- links: [
- { title: 'Getting Started', href: '/docs/how-to/getting-started' },
- { title: 'Peers', href: '/docs/how-to/peers' },
- { title: 'Setup Keys', href: '/docs/how-to/setup-keys' },
- { title: 'Access Control', href: '/docs/how-to/access-control' },
- { title: 'Network Routes', href: '/docs/how-to/network-routes' },
- { title: 'DNS', href: '/docs/how-to/dns' },
- { title: 'Users', href: '/docs/how-to/users' },
- { title: 'Activity', href: '/docs/how-to/activity' },
- { title: 'Settings', href: '/docs/how-to/settings' },
- { title: 'Examples', href: '/docs/how-to/examples' },
- { title: 'CLI', href: '/docs/how-to/cli' },
- ],
- },
- {
- title: 'Self-Hosted',
- links: [
- { title: 'Installation Guide', href: '/docs/selfhosted/selfhosted-guide' },
- { title: 'Identity Providers', href: '/docs/selfhosted/identity-providers' },
- ],
- },
-
-]
-
export const apiNavigation = [
{
title: 'Guides',
links: [
- { title: 'Quickstart', href: '/ipa/quickstart' },
- { title: 'Authentication', href: '/ipa/authentication' },
- { title: 'Errors', href: '/ipa/errors' },
+ { title: 'Quickstart', href: '/ipa/guides/quickstart' },
+ { title: 'Authentication', href: '/ipa/guides/authentication' },
+ { title: 'Errors', href: '/ipa/guides/errors' },
// { title: 'Events', href: '/accounts' },
],
},
{
title: 'Resources',
links: [
- { title: 'Accounts', href: '/ipa/accounts' },
- { title: 'Users', href: '/ipa/users' },
- { title: 'Tokens', href: '/ipa/tokens' },
- { title: 'Peers', href: '/ipa/peers' },
- { title: 'Setup Keys', href: '/ipa/setup-keys' },
- { title: 'Groups', href: '/ipa/groups' },
- { title: 'Rules', href: '/ipa/rules' },
- { title: 'Policies', href: '/ipa/policies' },
- { title: 'Routes', href: '/ipa/routes' },
- { title: 'DNS', href: '/ipa/dns' },
- { title: 'Events', href: '/ipa/events' },
+ { title: 'Accounts', href: '/ipa/resources/accounts' },
+ { title: 'Users', href: '/ipa/resources/users' },
+ { title: 'Tokens', href: '/ipa/resources/tokens' },
+ { title: 'Peers', href: '/ipa/resources/peers' },
+ { title: 'Setup Keys', href: '/ipa/resources/setup-keys' },
+ { title: 'Groups', href: '/ipa/resources/groups' },
+ { title: 'Rules', href: '/ipa/resources/rules' },
+ { title: 'Policies', href: '/ipa/resources/policies' },
+ { title: 'Routes', href: '/ipa/resources/routes' },
+ { title: 'DNS', href: '/ipa/resources/dns' },
+ { title: 'Events', href: '/ipa/resources/events' },
],
},
]
-export function NavigationAPI(props) {
- let router = useRouter()
+export function NavigationAPI(tableOfContents, props) {
return (
@@ -260,17 +224,11 @@ export function NavigationAPI(props) {
Github
Support
{
- router.route.startsWith('/docs') && docsNavigation.map((group, groupIndex) => (
-
- )) ||
- router.route.startsWith('/ipa') && apiNavigation.map((group, groupIndex) => (
+ apiNavigation.map((group, groupIndex) => (
))
diff --git a/src/components/NavigationDocs.jsx b/src/components/NavigationDocs.jsx
index 150a92c5..fae71f68 100644
--- a/src/components/NavigationDocs.jsx
+++ b/src/components/NavigationDocs.jsx
@@ -1,11 +1,45 @@
-import Link from 'next/link'
import { useRouter } from 'next/router'
import clsx from 'clsx'
-import {ActivePageMarker, docsNavigation, NavLink, TopLevelNavItem} from "@/components/NavigationAPI";
-import {useIsInsideMobileNavigation} from "@/components/MobileNavigation";
-import {useSectionStore} from "@/components/SectionProvider";
+import {ActivePageMarker, NavLink, TopLevelNavItem} from "@/components/NavigationAPI";
import {AnimatePresence, motion} from "framer-motion";
+export const docsNavigation = [
+ {
+ title: 'About NetBird',
+ links: [
+ { title: 'Why Wireguard with NetBird?', href: '/docs/about-netbird/why-wireguard-with-netbird' },
+ { title: 'How Netbird Works', href: '/docs/about-netbird/how-netbird-works' },
+ { title: 'NetBird vs. Traditional VPN', href: '/docs/about-netbird/netbird-vs-traditional-vpn' },
+ { title: 'Other', href: '/docs/about-netbird/other' },
+ { title: 'FAQ', href: '/docs/about-netbird/faq' },
+ ],
+ },
+ {
+ title: 'How-to',
+ links: [
+ { title: 'Getting Started', href: '/docs/how-to/getting-started' },
+ { title: 'Peers', href: '/docs/how-to/peers' },
+ { title: 'Setup Keys', href: '/docs/how-to/setup-keys' },
+ { title: 'Access Control', href: '/docs/how-to/access-control' },
+ { title: 'Network Routes', href: '/docs/how-to/network-routes' },
+ { title: 'DNS', href: '/docs/how-to/dns' },
+ { title: 'Users', href: '/docs/how-to/users' },
+ { title: 'Activity', href: '/docs/how-to/activity' },
+ { title: 'Settings', href: '/docs/how-to/settings' },
+ { title: 'Examples', href: '/docs/how-to/examples' },
+ { title: 'CLI', href: '/docs/how-to/cli' },
+ ],
+ },
+ {
+ title: 'Self-Hosted',
+ links: [
+ { title: 'Installation Guide', href: '/docs/selfhosted/selfhosted-guide' },
+ { title: 'Identity Providers', href: '/docs/selfhosted/identity-providers' },
+ ],
+ },
+
+]
+
export function NavigationDocs(props) {
return (
@@ -28,32 +62,6 @@ export function NavigationDocs(props) {
)
}
-//
-//
-// {section.title}
-//
-//
-// {section.links.map((link) => (
-//
-//
-// {link.title}
-//
-//
-// ))}
-//
-//
-
function NavigationGroup({ group, className }) {
// If this is the mobile navigation then we always render the initial
// state, so that the state does not change during the close animation.
diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx
index cd21fd98..2cf0edd2 100644
--- a/src/pages/_app.jsx
+++ b/src/pages/_app.jsx
@@ -33,16 +33,9 @@ export default function App({ Component, pageProps }) {
-
- {router.pathname.startsWith("/docs") ? (
-
-
-
- ) : (
-
-
-
- )}
+
+
+
>
)
diff --git a/src/pages/ipa/authentication.mdx b/src/pages/ipa/guides/authentication.mdx
similarity index 100%
rename from src/pages/ipa/authentication.mdx
rename to src/pages/ipa/guides/authentication.mdx
diff --git a/src/pages/ipa/errors.mdx b/src/pages/ipa/guides/errors.mdx
similarity index 100%
rename from src/pages/ipa/errors.mdx
rename to src/pages/ipa/guides/errors.mdx
diff --git a/src/pages/ipa/quickstart.mdx b/src/pages/ipa/guides/quickstart.mdx
similarity index 100%
rename from src/pages/ipa/quickstart.mdx
rename to src/pages/ipa/guides/quickstart.mdx
diff --git a/src/pages/ipa/accounts.mdx b/src/pages/ipa/resources/accounts.mdx
similarity index 100%
rename from src/pages/ipa/accounts.mdx
rename to src/pages/ipa/resources/accounts.mdx
diff --git a/src/pages/ipa/dns.mdx b/src/pages/ipa/resources/dns.mdx
similarity index 100%
rename from src/pages/ipa/dns.mdx
rename to src/pages/ipa/resources/dns.mdx
diff --git a/src/pages/ipa/events.mdx b/src/pages/ipa/resources/events.mdx
similarity index 100%
rename from src/pages/ipa/events.mdx
rename to src/pages/ipa/resources/events.mdx
diff --git a/src/pages/ipa/groups.mdx b/src/pages/ipa/resources/groups.mdx
similarity index 100%
rename from src/pages/ipa/groups.mdx
rename to src/pages/ipa/resources/groups.mdx
diff --git a/src/pages/ipa/peers.mdx b/src/pages/ipa/resources/peers.mdx
similarity index 100%
rename from src/pages/ipa/peers.mdx
rename to src/pages/ipa/resources/peers.mdx
diff --git a/src/pages/ipa/policies.mdx b/src/pages/ipa/resources/policies.mdx
similarity index 100%
rename from src/pages/ipa/policies.mdx
rename to src/pages/ipa/resources/policies.mdx
diff --git a/src/pages/ipa/routes.mdx b/src/pages/ipa/resources/routes.mdx
similarity index 100%
rename from src/pages/ipa/routes.mdx
rename to src/pages/ipa/resources/routes.mdx
diff --git a/src/pages/ipa/rules.mdx b/src/pages/ipa/resources/rules.mdx
similarity index 100%
rename from src/pages/ipa/rules.mdx
rename to src/pages/ipa/resources/rules.mdx
diff --git a/src/pages/ipa/setup-keys.mdx b/src/pages/ipa/resources/setup-keys.mdx
similarity index 100%
rename from src/pages/ipa/setup-keys.mdx
rename to src/pages/ipa/resources/setup-keys.mdx
diff --git a/src/pages/ipa/tokens.mdx b/src/pages/ipa/resources/tokens.mdx
similarity index 100%
rename from src/pages/ipa/tokens.mdx
rename to src/pages/ipa/resources/tokens.mdx
diff --git a/src/pages/ipa/users.mdx b/src/pages/ipa/resources/users.mdx
similarity index 100%
rename from src/pages/ipa/users.mdx
rename to src/pages/ipa/resources/users.mdx