docs: preparations for preview (#7267)

* configured base paths + added development banner

* fix typelist site url

* added navbar and sidebar badges

* configure algolia filters

* remove AI assistant

* remove unused imports

* change navbar text and badge

* lint fixes

* fix build error

* add to api reference rewrites

* fix build error

* fix build errors in user-guide

* fix feedback component

* add parent title to pagination

* added breadcrumbs component

* remove user-guide links

* resolve todos

* fix details about authentication

* change documentation title

* lint content
This commit is contained in:
Shahed Nasser
2024-05-13 11:32:52 +03:00
committed by GitHub
parent 3e3b8a483f
commit 728c5ee53c
62 changed files with 855 additions and 506 deletions
+11 -3
View File
@@ -1,10 +1,15 @@
import { ArrowUpRightOnBox } from "@medusajs/icons"
import { NavbarLinkProps, getNavbarItems, mobileSidebarItems } from "docs-ui"
import {
NavbarItem,
getNavbarItems,
legacyMobileSidebarItems,
mobileSidebarItemsV1,
} from "docs-ui"
import { SidebarSectionItemsType } from "types"
import { siteConfig } from "./site"
type DocsConfig = {
mainNav: NavbarLinkProps[]
mainNav: NavbarItem[]
sidebar: SidebarSectionItemsType
}
@@ -12,6 +17,7 @@ export const docsConfig: DocsConfig = {
mainNav: getNavbarItems({
basePath: siteConfig.baseUrl,
activePath: process.env.NEXT_PUBLIC_BASE_PATH || "/ui",
version: process.env.NEXT_PUBLIC_SHOW_V2 ? "v1" : "legacy",
}),
sidebar: {
top: [
@@ -279,6 +285,8 @@ export const docsConfig: DocsConfig = {
],
},
],
mobile: mobileSidebarItems,
mobile: process.env.NEXT_PUBLIC_SHOW_V2
? mobileSidebarItemsV1
: legacyMobileSidebarItems,
},
}
+1
View File
@@ -11,6 +11,7 @@ const baseUrl = process.env.NEXT_PUBLIC_DOCS_URL || "http://localhost:3000"
export const siteConfig: SiteConfig = {
name: "Medusa UI",
baseUrl,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
url: `${baseUrl}/${process.env.NEXT_PUBLIC_BASE_PATH}`,
description: "Primitives for building Medusa applications.",
// sidebar is defined in docs.tsx
+1 -1
View File
@@ -1,3 +1,3 @@
export function basePathUrl(path = "") {
return `${process.env.NEXT_PUBLIC_BASE_PATH}${path}`
return `${process.env.NEXT_PUBLIC_BASE_PATH || ""}${path}`
}
+2 -2
View File
@@ -4,7 +4,7 @@ import {
AiAssistantCommandIcon,
AiAssistantProvider,
SearchProvider as UiSearchProvider,
searchFilters,
searchFiltersV1,
} from "docs-ui"
import { absoluteUrl } from "../lib/absolute-url"
@@ -34,7 +34,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
},
],
checkInternalPattern: new RegExp(`^${absoluteUrl()}/ui`),
filterOptions: searchFilters,
filterOptions: searchFiltersV1,
}}
initialDefaultFilters={["ui"]}
commands={[