chore: reorganize docs apps (#7228)

* reorganize docs apps

* add README

* fix directory

* add condition for old docs
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-05-03 17:36:38 +03:00
1 parent 224ebb2154
commit 4fe28f5a95
6187 files changed
+601447 -598226

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
import { DocsConfig } from "types"
import { sidebarConfig } from "./sidebar"
export const config: DocsConfig = {
titleSuffix: "Medusa Book",
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000",
sidebar: sidebarConfig,
}
+24
View File
@@ -0,0 +1,24 @@
import { Badge, mobileSidebarItems } from "docs-ui"
import type { SidebarConfig, SidebarItemType } from "@/types"
import { sidebar } from "../sidebar.mjs"
const soonBadge = <Badge variant="blue">Soon</Badge>
const normalizeSidebarItems = (items: SidebarItemType[]) =>
items.map((item) => {
if (item.isSoon) {
item.additionalElms = soonBadge
}
if (item.children) {
item.children = normalizeSidebarItems(item.children as SidebarItemType[])
}
return item
})
export const sidebarConfig: SidebarConfig = {
top: normalizeSidebarItems(sidebar),
bottom: [],
mobile: mobileSidebarItems,
}