Move docs to root

This commit is contained in:
braginini
2023-05-23 21:34:03 +02:00
parent 8d913a349d
commit 04ea9c4991
32 changed files with 100 additions and 104 deletions

View File

@@ -3,18 +3,18 @@ import { Heading } from '@/components/Heading'
const aboutNetbird = [
{
href: '/docs/about-netbird/how-netbird-works',
href: '/about-netbird/how-netbird-works',
name: 'How NetBird works',
description: 'Concepts, architecture, protocols, and more.',
},
{
href: '/docs/about-netbird/netbird-vs-traditional-vpn',
href: '/about-netbird/netbird-vs-traditional-vpn',
name: 'NetBird vs. traditional VPN',
description:
'Learn how NetBird compares to traditional VPNs and why it is better.',
},
{
href: '/docs/about-netbird/why-wireguard-with-netbird',
href: '/about-netbird/why-wireguard-with-netbird',
name: 'Why WireGuard with NetBird',
description:
'Learn why and how NetBird uses WireGuard.',

View File

@@ -10,7 +10,7 @@ import { UsersIcon } from '@/components/icons/UsersIcon'
const clients = [
{
href: '/docs/client-installation#linux',
href: '/client-installation#linux',
name: 'Linux',
description:
'Learn how to install the NetBird client on Linux devices.',
@@ -24,7 +24,7 @@ const clients = [
},
},
{
href: '/docs/client-installation#mac-os',
href: '/client-installation#mac-os',
name: 'MacOS',
description:
'Learn how to install the NetBird client on MacOS devices.',
@@ -38,7 +38,7 @@ const clients = [
},
},
{
href: '/docs/client-installation#windows',
href: '/client-installation#windows',
name: 'Windows',
description:
'Learn how to install the NetBird client on Windows devices.',
@@ -52,7 +52,7 @@ const clients = [
},
},
{
href: '/docs/client-installation#android',
href: '/client-installation#android',
name: 'Android',
description:
'Learn how to install the NetBird client on Android devices.',
@@ -63,7 +63,7 @@ const clients = [
},
},
{
href: '/docs/client-installation#ios',
href: '/client-installation#ios',
name: 'iOS',
description:
'Learn how to install the NetBird client on OS devices.',

View File

@@ -126,7 +126,7 @@ function PageLink({ label, page, previous = false }) {
function PageNavigation() {
let router = useRouter()
let allPages = router.route.startsWith('/docs') ? docsNavigation.flatMap((group) => group.links) : apiNavigation.flatMap((group) => group.links)
let allPages = !router.route.startsWith('/ipa') ? docsNavigation.flatMap((group) => group.links) : apiNavigation.flatMap((group) => group.links)
let currentPageIndex = allPages.findIndex(
(page) => page.href === router.pathname
)

View File

@@ -69,7 +69,7 @@ export const Header = forwardRef(function Header({ className }, ref) {
<nav className="hidden md:block">
<ul role="list" className="flex items-center gap-8">
<TopLevelNavItem href="https://netbird.io/">Home</TopLevelNavItem>
<TopLevelNavItem href="/docs">Docs</TopLevelNavItem>
<TopLevelNavItem href="/">Docs</TopLevelNavItem>
<TopLevelNavItem href="/api">API</TopLevelNavItem>
<TopLevelNavItem href="https://netbird.io/blog/">Blog</TopLevelNavItem>
<TopLevelNavItem href="https://github.com/netbirdio/netbird">Github</TopLevelNavItem>

View File

@@ -3,35 +3,35 @@ import { Heading } from '@/components/Heading'
const howToGuides = [
{
href: '/docs/how-to/getting-started',
href: '/how-to/getting-started',
name: 'Quickstart guide',
description: 'Start using NetBird in under 5 minutes.',
},
{
href: '/docs/how-to/manage-network-access',
href: '/how-to/manage-network-access',
name: 'Manage network access',
description:
'Learn how to use access controls to manage access to your machines.',
},
{
href: '/docs/how-to/add-users-to-your-network',
href: '/how-to/add-users-to-your-network',
name: 'Add users to your network',
description: 'learn how to add team members to your NetBird network.',
},
{
href: '/docs/how-to/routing-traffic-to-private-networks',
href: '/how-to/routing-traffic-to-private-networks',
name: 'Route traffic to private networks',
description:
'Learn how to provide access to LANs, VPS, and corporate private networks.',
},
{
href: '/docs/how-to/monitor-system-and-network-activity',
href: '/how-to/monitor-system-and-network-activity',
name: 'Log and monitor network activity',
description:
'Learn how to keep track of system and network activities in your account.',
},
{
href: '/docs/how-to/manage-dns-in-your-network',
href: '/how-to/manage-dns-in-your-network',
name: 'Manage DNS in your network',
description:
'Learn how to configure name servers in your private network.',

View File

@@ -17,54 +17,54 @@ const navigation = [
title: 'Introduction',
links: [
{ title: 'Getting started', href: '/' },
{ title: 'Installation', href: '/docs/installation' },
{ title: 'Installation', href: '/installation' },
],
},
{
title: 'Core concepts',
links: [
{ title: 'Understanding caching', href: '/docs/understanding-caching' },
{ title: 'Understanding caching', href: '/understanding-caching' },
{
title: 'Predicting user behavior',
href: '/docs/predicting-user-behavior',
href: '/predicting-user-behavior',
},
{ title: 'Basics of time-travel', href: '/docs/basics-of-time-travel' },
{ title: 'Basics of time-travel', href: '/basics-of-time-travel' },
{
title: 'Introduction to string theory',
href: '/docs/introduction-to-string-theory',
href: '/introduction-to-string-theory',
},
{ title: 'The butterfly effect', href: '/docs/the-butterfly-effect' },
{ title: 'The butterfly effect', href: '/the-butterfly-effect' },
],
},
{
title: 'Advanced guides',
links: [
{ title: 'Writing plugins', href: '/docs/writing-plugins' },
{ title: 'Neuralink integration', href: '/docs/neuralink-integration' },
{ title: 'Temporal paradoxes', href: '/docs/temporal-paradoxes' },
{ title: 'Testing', href: '/docs/testing' },
{ title: 'Compile-time caching', href: '/docs/compile-time-caching' },
{ title: 'Writing plugins', href: '/writing-plugins' },
{ title: 'Neuralink integration', href: '/neuralink-integration' },
{ title: 'Temporal paradoxes', href: '/temporal-paradoxes' },
{ title: 'Testing', href: '/testing' },
{ title: 'Compile-time caching', href: '/compile-time-caching' },
{
title: 'Predictive data generation',
href: '/docs/predictive-data-generation',
href: '/predictive-data-generation',
},
],
},
{
title: 'API reference',
links: [
{ title: 'CacheAdvance.predict()', href: '/docs/cacheadvance-predict' },
{ title: 'CacheAdvance.flush()', href: '/docs/cacheadvance-flush' },
{ title: 'CacheAdvance.revert()', href: '/docs/cacheadvance-revert' },
{ title: 'CacheAdvance.regret()', href: '/docs/cacheadvance-regret' },
{ title: 'CacheAdvance.predict()', href: '/cacheadvance-predict' },
{ title: 'CacheAdvance.flush()', href: '/cacheadvance-flush' },
{ title: 'CacheAdvance.revert()', href: '/cacheadvance-revert' },
{ title: 'CacheAdvance.regret()', href: '/cacheadvance-regret' },
],
},
{
title: 'Contributing',
links: [
{ title: 'How to contribute', href: '/docs/how-to-contribute' },
{ title: 'Architecture guide', href: '/docs/architecture-guide' },
{ title: 'Design principles', href: '/docs/design-principles' },
{ title: 'How to contribute', href: '/how-to-contribute' },
{ title: 'Architecture guide', href: '/architecture-guide' },
{ title: 'Design principles', href: '/design-principles' },
],
},
]
@@ -159,7 +159,7 @@ export function Layout({ children, title, tableOfContents }) {
</div>
<Header />
{router.route.startsWith("/ipa") && <NavigationAPI className="hidden lg:mt-10 lg:block" tableOfContents={tableOfContents} />}
{router.route.startsWith("/docs") && <NavigationDocs className="hidden lg:mt-10 lg:block" />}
{!router.route.startsWith("/ipa") && <NavigationDocs className="hidden lg:mt-10 lg:block" />}
</div>
</motion.header>
<div className="min-w-0 max-w-2xl flex-auto px-4 py-16 lg:max-w-none lg:pl-8 lg:pr-0 xl:px-5">

View File

@@ -4,9 +4,9 @@ export function Logo(props) {
let router = useRouter()
return (
<div>
{router.route.startsWith('/docs') && <img src='/docs-static/img/logo/logo-docs.svg' alt="some file" height='200'
{!router.route.startsWith('/ipa') && <img src='/docs-static/img/logo/logo-docs.svg' alt="some file" height='200'
width='180' className="dark:hidden"/>}
{router.route.startsWith('/docs') && <img src='/docs-static/img/logo/logo-docs-dark.svg' alt="some file" height='200'
{!router.route.startsWith('/ipa') && <img src='/docs-static/img/logo/logo-docs-dark.svg' alt="some file" height='200'
width='180' className="hidden dark:block"/>}
{router.route.startsWith('/ipa') && <img src='/docs-static/img/logo/logo-api.svg' alt="some file" height='200'
width='180' className="dark:hidden"/>}

View File

@@ -40,7 +40,7 @@ export function NavigationAPI({tableOfContents, className}) {
<nav className={className}>
<ul role="list">
<TopLevelNavItem href="https://netbird.io/">Home</TopLevelNavItem>
<TopLevelNavItem href="/docs">Docs</TopLevelNavItem>
<TopLevelNavItem href="/">Docs</TopLevelNavItem>
<TopLevelNavItem href="/api">API</TopLevelNavItem>
<TopLevelNavItem href="https://netbird.io/blog/">Blog</TopLevelNavItem>
<TopLevelNavItem href="https://github.com/netbirdio/netbird">Github</TopLevelNavItem>

View File

@@ -8,35 +8,35 @@ 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: 'Why WireGuard with NetBird?', href: '/about-netbird/why-wireguard-with-netbird' },
{ title: 'How NetBird works', href: '/about-netbird/how-netbird-works' },
{ title: 'NetBird vs. traditional VPN', href: '/about-netbird/netbird-vs-traditional-vpn' },
{ title: 'Other', href: '/about-netbird/other' },
{ title: 'FAQ', href: '/about-netbird/faq' },
],
},
{
title: 'How-to guides',
links: [
{ title: 'Getting started', href: '/docs/how-to/getting-started' },
{ title: 'Installation', href: '/docs/how-to/installation' },
{ title: 'Use setup keys for automation', href: '/docs/how-to/register-machines-using-setup-keys' },
{ title: 'Manage network access', href: '/docs/how-to/manage-network-access' },
{ title: 'Add users to your network', href: '/docs/how-to/add-users-to-your-network' },
{ title: 'Access NetBird API', href: '/docs/how-to/access-netbird-public-api' },
{ title: 'Enforce periodic authentication', href: '/docs/how-to/enforce-periodic-user-authentication' },
{ title: 'Monitor system and network activity', href: '/docs/how-to/monitor-system-and-network-activity' },
{ title: 'Route traffic to private networks', href: '/docs/how-to/routing-traffic-to-private-networks' },
{ title: 'Manage DNS in your network', href: '/docs/how-to/manage-dns-in-your-network' },
{ title: 'Examples', href: '/docs/how-to/examples' },
{ title: 'CLI', href: '/docs/how-to/cli' },
{ title: 'Getting started', href: '/how-to/getting-started' },
{ title: 'Installation', href: '/how-to/installation' },
{ title: 'Use setup keys for automation', href: '/how-to/register-machines-using-setup-keys' },
{ title: 'Manage network access', href: '/how-to/manage-network-access' },
{ title: 'Add users to your network', href: '/how-to/add-users-to-your-network' },
{ title: 'Access NetBird API', href: '/how-to/access-netbird-public-api' },
{ title: 'Enforce periodic authentication', href: '/how-to/enforce-periodic-user-authentication' },
{ title: 'Monitor system and network activity', href: '/how-to/monitor-system-and-network-activity' },
{ title: 'Route traffic to private networks', href: '/how-to/routing-traffic-to-private-networks' },
{ title: 'Manage DNS in your network', href: '/how-to/manage-dns-in-your-network' },
{ title: 'Examples', href: '/how-to/examples' },
{ title: 'CLI', href: '/how-to/cli' },
],
},
{
title: 'Self-hosting NetBird',
links: [
{ title: 'Installation guide', href: '/docs/selfhosted/selfhosted-guide' },
{ title: 'Supported IdPs', href: '/docs/selfhosted/identity-providers' },
{ title: 'Installation guide', href: '/selfhosted/selfhosted-guide' },
{ title: 'Supported IdPs', href: '/selfhosted/identity-providers' },
],
},
@@ -47,7 +47,7 @@ export function NavigationDocs({className}) {
<nav className={className}>
<ul role="list">
<TopLevelNavItem href="https://netbird.io/">Home</TopLevelNavItem>
<TopLevelNavItem href="/docs">Docs</TopLevelNavItem>
<TopLevelNavItem href="/">Docs</TopLevelNavItem>
<TopLevelNavItem href="/api">API</TopLevelNavItem>
<TopLevelNavItem href="https://netbird.io/blog/">Blog</TopLevelNavItem>
<TopLevelNavItem href="https://github.com/netbirdio/netbird">Github</TopLevelNavItem>