-
+
diff --git a/app/routes/documentation-page.tsx b/app/routes/documentation-page-sectioned.tsx
similarity index 50%
rename from app/routes/documentation-page.tsx
rename to app/routes/documentation-page-sectioned.tsx
index 1e622b8..eaf97d8 100644
--- a/app/routes/documentation-page.tsx
+++ b/app/routes/documentation-page-sectioned.tsx
@@ -1,27 +1,23 @@
-import GithubContributeLinks from "~/components/github-contribute-links"
-import PageMdxArticle from "~/components/page-mdx-article"
-import { PageNavigation } from "~/components/page-navigation"
-import { TableOfContents } from "~/components/table-of-content"
+import { DocumentationPageView } from "~/components/documentation-page-view"
import { useDocumentationLayoutLoaderData } from "~/hooks/use-documentation-layout-loader-data"
import { usePreviousNextPages } from "~/hooks/use-previous-next-pages"
-import { extractHeadingTreeFromMarkdown } from "~/utils/extract-heading-tree-from-mdx"
import { getDomain } from "~/utils/get-domain"
import { loadContentCollections } from "~/utils/load-content-collections"
import { generateMetaFields } from "~/utils/seo"
import { splitSlug } from "~/utils/split-slug"
import { normalizeVersion } from "~/utils/version-resolvers"
-import type { Route } from "./+types/documentation-page"
+import type { Route } from "./+types/documentation-page-sectioned"
export const meta = ({ data }: Route.MetaArgs) => {
const { page, domain, version } = data
- const title = page.title
- const description = page.description
const { section, subsection, filename } = splitSlug(page.slug)
+ const path = [version, section, subsection, filename].filter(Boolean).join("/")
return generateMetaFields({
domain,
- path: `/${version}/${section}/${subsection}/${filename}`,
- title: `${title} · Package Name`,
- description,
+ path: `/${path}`,
+ // change "Package Name" to your package name
+ title: `${page.title} · Package Name`,
+ description: page.description,
})
}
@@ -30,7 +26,6 @@ export async function loader({ params, request }: Route.LoaderArgs) {
if (!section || !filename) throw new Response("Not Found", { status: 404 })
const { version } = normalizeVersion(v)
-
const slug = [section, subsection, filename].filter(Boolean).join("/")
const { allPages } = await loadContentCollections(version)
@@ -41,26 +36,12 @@ export async function loader({ params, request }: Route.LoaderArgs) {
return { page, version, domain }
}
-export type Page = Awaited
>["page"]
-
export default function DocumentationPage({ loaderData }: Route.ComponentProps) {
const { page } = loaderData
- const { sidebarTree } = useDocumentationLayoutLoaderData()
- const { previous, next } = usePreviousNextPages(sidebarTree)
- const toc = extractHeadingTreeFromMarkdown(page.rawMdx)
+ const {
+ sidebarTree: { sections, documentationPages },
+ } = useDocumentationLayoutLoaderData()
+ const { previous, next } = usePreviousNextPages(sections, documentationPages)
- return (
-
- )
+ return
}
diff --git a/app/routes/documentation-page-standalone.tsx b/app/routes/documentation-page-standalone.tsx
new file mode 100644
index 0000000..19496e7
--- /dev/null
+++ b/app/routes/documentation-page-standalone.tsx
@@ -0,0 +1,50 @@
+import { DocumentationPageView } from "~/components/documentation-page-view"
+import { useDocumentationLayoutLoaderData } from "~/hooks/use-documentation-layout-loader-data"
+import { usePreviousNextPages } from "~/hooks/use-previous-next-pages"
+import { getDomain } from "~/utils/get-domain"
+import { loadContentCollections } from "~/utils/load-content-collections"
+import { generateMetaFields } from "~/utils/seo"
+import { normalizeVersion } from "~/utils/version-resolvers"
+import type { Route } from "./+types/documentation-page-standalone"
+
+export const meta = ({ data }: Route.MetaArgs) => {
+ const { page, domain, version } = data
+ // standalone path: /:version?/:filename
+ //TODO helper function
+ const filename = page.slug.split("/").filter(Boolean).at(-1) ?? page.slug
+ const path = [version, filename].filter(Boolean).join("/")
+ return generateMetaFields({
+ domain,
+ path: `/${path}`,
+ // change "Package Name" to your package name
+ title: `${page.title} · Package Name`,
+ description: page.description,
+ })
+}
+
+export async function loader({ params, request }: Route.LoaderArgs) {
+ const { version: v, filename } = params
+ if (!filename) throw new Response("Not Found", { status: 404 })
+
+ const { version } = normalizeVersion(v)
+
+ // For standalone, slug IS the filename (no section/subsection)
+ const slug = filename
+
+ const { allPages } = await loadContentCollections(version)
+ const page = allPages.find((p) => p.slug === slug)
+ if (!page) throw new Response("Not Found", { status: 404 })
+
+ const { domain } = getDomain(request)
+ return { page, version, domain }
+}
+
+export default function DocumentationStandalonePage({ loaderData }: Route.ComponentProps) {
+ const { page } = loaderData
+ const {
+ sidebarTree: { sections, documentationPages },
+ } = useDocumentationLayoutLoaderData()
+ const { previous, next } = usePreviousNextPages(sections, documentationPages)
+
+ return
+}
diff --git a/app/utils/create-sidebar-tree.ts b/app/utils/create-sidebar-tree.ts
index b1a7cb6..a29ec57 100644
--- a/app/utils/create-sidebar-tree.ts
+++ b/app/utils/create-sidebar-tree.ts
@@ -1,3 +1,4 @@
+import type { Page } from "content-collections"
import type { SidebarSection } from "~/components/sidebar/sidebar"
import { loadContentCollections } from "./load-content-collections"
import type { Version } from "./version-resolvers"
@@ -10,11 +11,8 @@ const parentOf = (slug: string) => {
export async function createSidebarTree(version: Version) {
const { allPages, allSections } = await loadContentCollections(version)
- const sections = allSections
- const pages = allPages
-
const sectionMap = new Map()
- for (const s of sections) {
+ for (const s of allSections) {
sectionMap.set(s.slug, {
...s,
subsections: [],
@@ -28,13 +26,23 @@ export async function createSidebarTree(version: Version) {
if (parent) parent.subsections.push(node)
}
- for (const p of pages) {
+ const documentationPages: Page[] = []
+ for (const p of allPages) {
const parts = p.slug.split("/").filter(Boolean)
- if (parts.length < 2) continue
+
+ if (parts.length < 2) {
+ if (p.slug !== "index" && !p.slug.startsWith("_")) {
+ documentationPages.push({ ...p, slug: p.slug, title: p.title })
+ }
+ continue
+ }
+
const parentSlug = parts.length >= 3 ? parts.slice(0, 2).join("/") : parts[0]
const parent = sectionMap.get(parentSlug)
if (parent) parent.documentationPages.push({ slug: p.slug, title: p.title })
}
- return [...sectionMap.values()].filter((s) => !sectionMap.has(parentOf(s.slug)))
+ const sections = [...sectionMap.values()].filter((s) => !sectionMap.has(parentOf(s.slug)))
+
+ return { sections, documentationPages }
}
diff --git a/app/utils/load-content-collections.ts b/app/utils/load-content-collections.ts
index 447d445..1f7cb29 100644
--- a/app/utils/load-content-collections.ts
+++ b/app/utils/load-content-collections.ts
@@ -1,5 +1,7 @@
import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"
+import type { Page } from "content-collections"
+import type { Section } from "content-collections"
import type { Version } from "./version-resolvers"
/**
@@ -15,8 +17,8 @@ export async function loadContentCollections(version: Version) {
const pagesMod = await import(/* @vite-ignore */ `${genBase}/allPages.js`)
const sectionsMod = await import(/* @vite-ignore */ `${genBase}/allSections.js`)
- const allPages = pagesMod.default
- const allSections = sectionsMod.default
+ const allPages = pagesMod.default as Page[]
+ const allSections = sectionsMod.default as Section[]
if (!Array.isArray(allPages) || !Array.isArray(allSections)) {
throw new Error(`Generated modules must default-export arrays (allPages/allSections) for version ${version}.`)
}
diff --git a/content-collections.ts b/content-collections.ts
index 15d3f1e..98cb250 100644
--- a/content-collections.ts
+++ b/content-collections.ts
@@ -6,20 +6,20 @@ import { z } from "zod"
const sectionSchema = z.object({
title: z.string(),
})
-
const pageSchema = z.object({
title: z.string(),
summary: z.string(),
description: z.string(),
})
-
const metaSchema = z.object({ path: z.string() }).partial().optional()
+
const outputBaseSchema = z.object({
slug: z.string(),
_meta: metaSchema,
})
const sectionOutputSchema = sectionSchema.extend(outputBaseSchema.shape)
+
const pageOutputSchema = pageSchema.extend({
...outputBaseSchema.shape,
section: z.string().optional(),
@@ -75,7 +75,6 @@ const page = defineCollection({
})
// rawMdx is the content without the frontmatter, used to read headings from the mdx file and create a content tree for the table of content component
const rawMdx = document.content.replace(/^---\s*[\r\n](.*?|\r|\n)---/, "").trim()
-
return {
...document,
content,
diff --git a/content/01-changelog.mdx b/content/01-changelog.mdx
new file mode 100644
index 0000000..a042961
--- /dev/null
+++ b/content/01-changelog.mdx
@@ -0,0 +1,15 @@
+---
+title: Changelog
+summary: "Latest updates and changes"
+description: "Stay updated with the latest changes, features, and improvements in the Forge42 Base Stack."
+---
+
+## Changelog
+Welcome to the changelog for the Forge42 Base Stack! Here, you'll find a detailed record of all the updates, features, bug fixes, and improvements made to the project over time. This document is essential for developers and users who want to stay informed about the evolution of the stack.
+## Version 1.0.0 - Initial Release
+- **Release Date:** January 15, 2024
+- **Features:**
+ - Initial release of the Forge42 Base Stack.
+ - Includes core technologies: Remix, Tailwind CSS, TypeScript, Vitest, and React Aria Components.
+ - Basic project structure and configuration set up.
+ - Sample components and pages to demonstrate functionality.
diff --git a/content/02-introduction.mdx b/content/02-introduction.mdx
new file mode 100644
index 0000000..5580ee6
--- /dev/null
+++ b/content/02-introduction.mdx
@@ -0,0 +1,16 @@
+---
+title: "Introduction to Forge42 Base Stack"
+summary: "Overview of the Stack"
+description: "Get started with the Forge42 Base Stack — a modern web app starter template designed for speed, scalability, and developer experience."
+---
+
+## What is Forge42 Base Stack?
+The Forge42 Base Stack is a full-featured web application starter template. It combines modern tools and technologies like **Remix**, **Tailwind CSS**, **TypeScript**, **Vitest**, and **React Aria Components** to help you build accessible and scalable web apps quickly.
+This documentation will guide you through setting up the project, understanding its structure, and customizing it for your needs.
+## Installation
+To get started with the base stack, simply clone the repository and install dependencies:
+```bash
+npx degit forge42/base-stack my-app
+cd my-app
+npm install
+```
diff --git a/content/03-overview.mdx b/content/03-overview.mdx
new file mode 100644
index 0000000..f47e625
--- /dev/null
+++ b/content/03-overview.mdx
@@ -0,0 +1,38 @@
+---
+title: "Overview of the Forge42 Base Stack"
+summary: "A comprehensive look at the features and architecture"
+description: "Explore the key features, architecture, and benefits of using the Forge42 Base Stack for your web applications."
+---
+
+## Key Features
+The Forge42 Base Stack offers a robust set of features designed to streamline your development process:
+- **Modern Tech Stack**: Built with the latest versions of Remix, Tailwind CSS, TypeScript, Vitest, and React Aria Components.
+- **Scalability**: Designed to grow with your application, making it easy to add new features and components.
+- **Accessibility**: Utilizes React Aria Components to ensure your application is accessible to all users.
+- **Performance Optimization**: Includes best practices for performance, ensuring fast load times and smooth user experiences.
+- **Developer Experience**: Comes with a well-structured project setup, comprehensive documentation, and testing tools to enhance productivity.
+- **Customizable**: Easily adaptable to fit the specific needs of your project.
+- **Community Support**: Backed by a community of developers and contributors who provide support and share best practices.
+- **Regular Updates**: Continuously maintained with updates to dependencies and new features.
+- **Comprehensive Documentation**: Detailed guides and references to help you get the most out of the stack.
+- **Testing Framework**: Integrated Vitest for unit and integration testing, ensuring code quality and reliability.
+- **Responsive Design**: Built with Tailwind CSS to ensure your application looks great on all devices.
+- **Type Safety**: Leveraging TypeScript to catch errors early and improve code maintainability.
+- **SEO Friendly**: Optimized for search engines to help your application rank better.
+- **API Integration**: Simplified data fetching and state management with built-in patterns and practices.
+- **Environment Configuration**: Easy management of different environments (development, staging, production) with environment variables.
+- **Error Handling**: Robust error handling mechanisms to improve application stability.
+- **Authentication & Authorization**: Ready-to-use patterns for implementing secure user authentication and role-based access control.
+- **CI/CD Ready**: Easily integrates with continuous integration and deployment pipelines for automated workflows.
+- **Open Source**: Fully open-source, allowing you to contribute and customize as needed.
+- **Example Projects**: Comes with example projects to help you get started quickly and understand best practices.
+- **Modular Architecture**: Encourages a modular approach to building applications, making it easier to manage and scale codebases.
+- **Community Plugins**: Supports a variety of community plugins and extensions to enhance functionality.
+- **Internationalization (i18n)**: Built-in support for multiple languages to reach a global audience.
+- **State Management**: Provides patterns for effective state management using modern libraries and techniques.
+- **Logging & Monitoring**: Integrates with popular logging and monitoring tools to help you track application performance and issues.
+- **Comprehensive CLI**: Command-line tools to automate common tasks and streamline development workflows.
+- **Code Quality Tools**: Integrated linters and formatters to maintain high code quality and consistency across the project.
+- **Documentation Generation**: Tools to help you generate and maintain project documentation easily.
+- **Community Contributions**: Encourages contributions from the community to enhance and expand the stack's capabilities.
+- **Learning Resources**: Access to tutorials, guides, and other learning materials to help you master the stack.
diff --git a/content/01-started/01-installation.mdx b/content/04-started/01-installation.mdx
similarity index 100%
rename from content/01-started/01-installation.mdx
rename to content/04-started/01-installation.mdx
diff --git a/content/01-started/02-fac/01-common-questions.mdx b/content/04-started/02-fac/01-common-questions.mdx
similarity index 100%
rename from content/01-started/02-fac/01-common-questions.mdx
rename to content/04-started/02-fac/01-common-questions.mdx
diff --git a/content/01-started/02-fac/index.md b/content/04-started/02-fac/index.md
similarity index 100%
rename from content/01-started/02-fac/index.md
rename to content/04-started/02-fac/index.md
diff --git a/content/01-started/index.md b/content/04-started/index.md
similarity index 100%
rename from content/01-started/index.md
rename to content/04-started/index.md
diff --git a/content/02-configuration/01-general.mdx b/content/05-configuration/01-general.mdx
similarity index 100%
rename from content/02-configuration/01-general.mdx
rename to content/05-configuration/01-general.mdx
diff --git a/content/02-configuration/02-client.mdx b/content/05-configuration/02-client.mdx
similarity index 100%
rename from content/02-configuration/02-client.mdx
rename to content/05-configuration/02-client.mdx
diff --git a/content/02-configuration/03-editor.mdx b/content/05-configuration/03-editor.mdx
similarity index 100%
rename from content/02-configuration/03-editor.mdx
rename to content/05-configuration/03-editor.mdx
diff --git a/content/02-configuration/04-server.mdx b/content/05-configuration/04-server.mdx
similarity index 100%
rename from content/02-configuration/04-server.mdx
rename to content/05-configuration/04-server.mdx
diff --git a/content/02-configuration/index.md b/content/05-configuration/index.md
similarity index 100%
rename from content/02-configuration/index.md
rename to content/05-configuration/index.md
diff --git a/content/03-features/01-shortcuts.mdx b/content/06-features/01-shortcuts.mdx
similarity index 100%
rename from content/03-features/01-shortcuts.mdx
rename to content/06-features/01-shortcuts.mdx
diff --git a/content/03-features/02-devtools.mdx b/content/06-features/02-devtools.mdx
similarity index 100%
rename from content/03-features/02-devtools.mdx
rename to content/06-features/02-devtools.mdx
diff --git a/content/03-features/03-active-page-tab.mdx b/content/06-features/03-active-page-tab.mdx
similarity index 100%
rename from content/03-features/03-active-page-tab.mdx
rename to content/06-features/03-active-page-tab.mdx
diff --git a/content/03-features/04-routes-tab.mdx b/content/06-features/04-routes-tab.mdx
similarity index 100%
rename from content/03-features/04-routes-tab.mdx
rename to content/06-features/04-routes-tab.mdx
diff --git a/content/03-features/05-network-tab.mdx b/content/06-features/05-network-tab.mdx
similarity index 100%
rename from content/03-features/05-network-tab.mdx
rename to content/06-features/05-network-tab.mdx
diff --git a/content/03-features/06-errors-tab.mdx b/content/06-features/06-errors-tab.mdx
similarity index 100%
rename from content/03-features/06-errors-tab.mdx
rename to content/06-features/06-errors-tab.mdx
diff --git a/content/03-features/07-settings-tab.mdx b/content/06-features/07-settings-tab.mdx
similarity index 100%
rename from content/03-features/07-settings-tab.mdx
rename to content/06-features/07-settings-tab.mdx
diff --git a/content/03-features/08-detach.mdx b/content/06-features/08-detach.mdx
similarity index 100%
rename from content/03-features/08-detach.mdx
rename to content/06-features/08-detach.mdx
diff --git a/content/03-features/index.md b/content/06-features/index.md
similarity index 100%
rename from content/03-features/index.md
rename to content/06-features/index.md
diff --git a/content/04-guides/01-migration.mdx b/content/07-guides/01-migration.mdx
similarity index 100%
rename from content/04-guides/01-migration.mdx
rename to content/07-guides/01-migration.mdx
diff --git a/content/04-guides/02-plugins.mdx b/content/07-guides/02-plugins.mdx
similarity index 100%
rename from content/04-guides/02-plugins.mdx
rename to content/07-guides/02-plugins.mdx
diff --git a/content/04-guides/04-hydrogen-oxygen.mdx b/content/07-guides/04-hydrogen-oxygen.mdx
similarity index 100%
rename from content/04-guides/04-hydrogen-oxygen.mdx
rename to content/07-guides/04-hydrogen-oxygen.mdx
diff --git a/content/04-guides/05-contributing.mdx b/content/07-guides/05-contributing.mdx
similarity index 100%
rename from content/04-guides/05-contributing.mdx
rename to content/07-guides/05-contributing.mdx
diff --git a/content/04-guides/index.md b/content/07-guides/index.md
similarity index 100%
rename from content/04-guides/index.md
rename to content/07-guides/index.md
From f60013e284f5b3260d6c9cd262d966cc3ecde00a Mon Sep 17 00:00:00 2001
From: abrulic1
Date: Mon, 8 Sep 2025 11:01:39 +0200
Subject: [PATCH 03/40] small changes
---
.env.example | 2 +-
app/components/sidebar/build-breadcrumbs.ts | 13 +-
app/components/sidebar/desktop-sidebar.tsx | 11 +-
app/components/sidebar/mobile-sidebar.tsx | 11 +-
app/components/sidebar/sidebar-content.tsx | 15 +-
app/components/sidebar/sidebar.tsx | 15 +-
.../sidebar/tests/build-breadcrumbs.test.ts | 175 +++++++++---------
app/routes/documentation-layout.tsx | 6 +-
app/utils/build-doc-path-from-slug.ts | 12 ++
app/utils/create-sidebar-tree.ts | 23 ++-
10 files changed, 142 insertions(+), 141 deletions(-)
create mode 100644 app/utils/build-doc-path-from-slug.ts
diff --git a/.env.example b/.env.example
index f2c1ef0..0372c39 100644
--- a/.env.example
+++ b/.env.example
@@ -1,4 +1,4 @@
GITHUB_OWNER="github-owner" # Your username or organization name (Optional. For edit/report an issue for the documentation page)
GITHUB_REPO="github-repo" # Repository name (Optional. For edit/report an issue for the documentation page)
APP_ROOT_PATH="/path/to/your/app" # Optional. Default is `process.cwd()`
-GITHUB_REPO_URL="github-repo-url" #Optional
+GITHUB_REPO_URL="github-repo-url" #Optional - if you want to have discord icon link in the header or footer
diff --git a/app/components/sidebar/build-breadcrumbs.ts b/app/components/sidebar/build-breadcrumbs.ts
index b61c516..c000e9a 100644
--- a/app/components/sidebar/build-breadcrumbs.ts
+++ b/app/components/sidebar/build-breadcrumbs.ts
@@ -1,28 +1,27 @@
import type { Page } from "content-collections"
-import { splitSlug } from "~/utils/split-slug"
-import type { SidebarSection } from "./sidebar"
+import { buildDocPathFromSlug } from "~/utils/build-doc-path-from-slug"
+import type { SidebarSection } from "~/utils/create-sidebar-tree"
export const buildBreadcrumbs = (
items: SidebarSection[],
pathname: string,
documentationPages: Pick[] = []
) => {
- // 1) Standalone pages: /:filename
+ // for standalone pages: /:filename
for (const page of documentationPages) {
- const filename = page.slug.split("/").filter(Boolean).at(-1) ?? page.slug
+ const filename = buildDocPathFromSlug(page.slug)
const docPath = `/${filename}`
if (docPath === pathname) {
return [page.title]
}
}
- // 2) Sectioned pages: /:section/:subsection?/:filename
+ // for ectioned pages: /:section/:subsection?/:filename
let trail: string[] = []
const walk = (section: SidebarSection, acc: string[]): boolean => {
for (const doc of section.documentationPages) {
- const { section: sec, subsection, filename } = splitSlug(doc.slug)
- const docPath = `/${[sec, subsection, filename].filter(Boolean).join("/")}`
+ const docPath = buildDocPathFromSlug(doc.slug)
if (docPath === pathname) {
trail = [...acc, section.title, doc.title]
return true
diff --git a/app/components/sidebar/desktop-sidebar.tsx b/app/components/sidebar/desktop-sidebar.tsx
index 16bdcc2..eade5e9 100644
--- a/app/components/sidebar/desktop-sidebar.tsx
+++ b/app/components/sidebar/desktop-sidebar.tsx
@@ -1,19 +1,14 @@
-import type { Page } from "content-collections"
+import type { SidebarTree } from "~/utils/create-sidebar-tree"
import { cn } from "~/utils/css"
-import type { SidebarSection } from "./sidebar"
import { SidebarContent } from "./sidebar-content"
-export const DesktopSidebarPanel = ({
- items,
- documentationPages,
- className,
-}: { items: SidebarSection[]; documentationPages: Page[]; className: string }) => (
+export const DesktopSidebarPanel = ({ sidebarTree, className }: { sidebarTree: SidebarTree; className: string }) => (
-
+
)
diff --git a/app/components/sidebar/mobile-sidebar.tsx b/app/components/sidebar/mobile-sidebar.tsx
index 6f9dffa..fd2ddcd 100644
--- a/app/components/sidebar/mobile-sidebar.tsx
+++ b/app/components/sidebar/mobile-sidebar.tsx
@@ -1,12 +1,11 @@
-import type { Page } from "content-collections"
import { useParams } from "react-router"
import { useDocumentationLayoutLoaderData } from "~/hooks/use-documentation-layout-loader-data"
import { BreadcrumbItem, Breadcrumbs } from "~/ui/breadcrumbs"
import { Icon } from "~/ui/icon/icon"
+import type { SidebarTree } from "~/utils/create-sidebar-tree"
import { cn } from "~/utils/css"
import { buildBreadcrumbs } from "./build-breadcrumbs"
import { useMobileSidebar } from "./mobile-sidebar-context"
-import type { SidebarSection } from "./sidebar"
import { SidebarContent } from "./sidebar-content"
const MobileSidebarMenuButton = () => {
@@ -76,12 +75,10 @@ const MobileSidebarCloseButton = () => {
}
export const MobileSidebarPanel = ({
- items,
- documentationPages,
+ sidebarTree,
className,
}: {
- items: SidebarSection[]
- documentationPages: Page[]
+ sidebarTree: SidebarTree
className: string
}) => {
const { close, isOpen } = useMobileSidebar()
@@ -94,7 +91,7 @@ export const MobileSidebarPanel = ({
)}
aria-label="Navigation menu"
>
-
+
)
diff --git a/app/components/sidebar/sidebar-content.tsx b/app/components/sidebar/sidebar-content.tsx
index 50c572a..4976e7c 100644
--- a/app/components/sidebar/sidebar-content.tsx
+++ b/app/components/sidebar/sidebar-content.tsx
@@ -1,28 +1,24 @@
-import type { Page } from "content-collections"
import { useMobileView } from "~/hooks/use-mobile-view"
import { Accordion } from "~/ui/accordion"
-import type { SidebarSection } from "./sidebar"
+import type { SidebarTree } from "~/utils/create-sidebar-tree"
import { SectionItem } from "./sidebar-section"
import { StandaloneItemLink } from "./standalone-item-link"
export const SidebarContent = ({
- items,
- documentationPages = [],
+ sidebarTree,
onClose,
}: {
- items: SidebarSection[]
- documentationPages?: Page[]
+ sidebarTree: SidebarTree
onClose?: () => void
}) => {
const { isMobile } = useMobileView()
const handle = isMobile ? onClose : undefined
-
+ const { sections, documentationPages } = sidebarTree
return (