diff --git a/.vitepress/components/NavItem.vue b/.vitepress/components/NavItem.vue new file mode 100644 index 00000000..d2f8dd3a --- /dev/null +++ b/.vitepress/components/NavItem.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/.vitepress/components/Navbar.vue b/.vitepress/components/Navbar.vue index 0e86f1ff..6def1572 100644 --- a/.vitepress/components/Navbar.vue +++ b/.vitepress/components/Navbar.vue @@ -89,6 +89,13 @@ const isActive = (link: string) => { border-bottom-color: var(--vp-c-brand-1); } +/* Hide second navbar on mobile; section links are in the hamburger menu */ +@media (max-width: 960px) { + .second-navbar { + display: none; + } +} + @media (max-width: 768px) { .second-navbar-container { padding: 8px 16px; diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 37674b45..8052ffc3 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -4,10 +4,8 @@ import llmstxt from "vitepress-plugin-llms"; import type { DefaultTheme } from "vitepress"; import MermaidExample from "./mermaid"; -import { - appSidebars, - dashboardSidebars, -} from "./sidebars"; +import { appNavbar, dashboardNavbar } from "./navbars"; +import { appSidebars, dashboardSidebars } from "./sidebars"; // https://vitepress.dev/reference/site-config export default defineConfig({ @@ -63,12 +61,31 @@ export default defineConfig({ nav: [ { - text: "Application", - link: "/app/quickstart/", - activeMatch: "^/app(/.*)?$", + component: "NavItem", + props: { + text: "Application", + link: "/app/quickstart/", + activeMatch: "^/app(/.*)?$", + items: appNavbar, + }, + }, + { + component: "NavItem", + props: { + text: "Dashboard", + link: "/dashboard/quickstart/", + activeMatch: "^/dashboard(/|$)", + items: dashboardNavbar, + }, + }, + { + component: "NavItem", + props: { + text: "FAQ", + link: "/faq/", + activeMatch: "^/faq(/|$)", + }, }, - { text: "Dashboard", link: "/dashboard/quickstart/", activeMatch: "^/dashboard(/|$)" }, - { text: "FAQ", link: "/faq", activeMatch: "^/faq(/|$)" }, ] satisfies DefaultTheme.NavItem[], sidebar: { diff --git a/.vitepress/navbars/app.ts b/.vitepress/navbars/app.ts index 96e7a09e..53e2ebd2 100644 --- a/.vitepress/navbars/app.ts +++ b/.vitepress/navbars/app.ts @@ -1,6 +1,6 @@ import type { DefaultTheme } from "vitepress"; -export const appNavbar: DefaultTheme.NavItem[] = [ +export const appNavbar: DefaultTheme.NavItemWithLink[] = [ { text: "Get Started", link: "/app/quickstart/" }, { text: "How-to Guides", link: "/app/guides/" }, { text: "Tutorials", link: "/app/tutorials/" }, diff --git a/.vitepress/navbars/dashboard.ts b/.vitepress/navbars/dashboard.ts index fada4179..1cc2a41b 100644 --- a/.vitepress/navbars/dashboard.ts +++ b/.vitepress/navbars/dashboard.ts @@ -1,6 +1,6 @@ import type { DefaultTheme } from "vitepress"; -export const dashboardNavbar: DefaultTheme.NavItem[] = [ +export const dashboardNavbar: DefaultTheme.NavItemWithLink[] = [ { text: "Get Started", link: "/dashboard/quickstart/" }, { text: "Guides", link: "/dashboard/guides/" }, { text: "Concepts", link: "/dashboard/concepts/" }, diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue index 969d3b71..6fc2f9ad 100644 --- a/.vitepress/theme/Layout.vue +++ b/.vitepress/theme/Layout.vue @@ -12,15 +12,25 @@ const { Layout } = DefaultThemeComponent;