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:
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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,3 +1,3 @@
|
||||
export function basePathUrl(path = "") {
|
||||
return `${process.env.NEXT_PUBLIC_BASE_PATH}${path}`
|
||||
return `${process.env.NEXT_PUBLIC_BASE_PATH || ""}${path}`
|
||||
}
|
||||
|
||||
@@ -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={[
|
||||
|
||||
Reference in New Issue
Block a user