docs: improve main docs and resources sidebar (#8664)
This commit is contained in:
@@ -13,11 +13,13 @@ export const sidebar = numberSidebarItems(
|
||||
type: "link",
|
||||
path: "/first-customizations",
|
||||
title: "Your First Customizations",
|
||||
chapterTitle: "First Customization",
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
path: "/basics",
|
||||
title: "The Basics",
|
||||
chapterTitle: "Basics",
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -85,6 +87,7 @@ export const sidebar = numberSidebarItems(
|
||||
type: "link",
|
||||
path: "/advanced-development",
|
||||
title: "Advanced Development",
|
||||
chapterTitle: "Advanced",
|
||||
children: [
|
||||
{
|
||||
type: "sub-category",
|
||||
@@ -340,6 +343,7 @@ export const sidebar = numberSidebarItems(
|
||||
type: "link",
|
||||
path: "/storefront-development",
|
||||
title: "Storefront Development",
|
||||
chapterTitle: "Storefront",
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -357,6 +361,7 @@ export const sidebar = numberSidebarItems(
|
||||
type: "link",
|
||||
path: "/debugging-and-testing",
|
||||
title: "Debugging and Testing",
|
||||
chapterTitle: "Debugging & Testing",
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
|
||||
Vendored
+1
@@ -3,6 +3,7 @@ import { SidebarSectionItems, SidebarItem as SidebarItemType } from "types"
|
||||
export declare type SidebarItem = SidebarItemType & {
|
||||
isSoon: boolean
|
||||
number?: string
|
||||
chapterTitle?: string
|
||||
}
|
||||
|
||||
export declare type SidebarConfig = SidebarSectionItems
|
||||
|
||||
@@ -21,13 +21,16 @@ export default function numberSidebarItems(sidebarItems, numbering = [1]) {
|
||||
|
||||
// append current number to the item's title
|
||||
item.number = `${numbering.join(".")}.`
|
||||
item.chapterTitle = `${item.number} ${
|
||||
item.chapterTitle?.trim() || item.title?.trim()
|
||||
}`
|
||||
item.title = `${item.number} ${item.title.trim()}`
|
||||
|
||||
if (isTopItems) {
|
||||
// Add chapter category
|
||||
numberedItems.push({
|
||||
type: "category",
|
||||
title: item.title,
|
||||
title: item.chapterTitle,
|
||||
children: [],
|
||||
loaded: true,
|
||||
initialOpen: false,
|
||||
|
||||
@@ -20,6 +20,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "API Key Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -198,6 +199,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Auth Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -431,6 +433,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Cart Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -1007,6 +1010,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Currency",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -1127,6 +1131,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Customer",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -1447,6 +1452,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Fulfillment Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -2192,6 +2198,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Inventory Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -2600,6 +2607,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Order Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -3945,6 +3953,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Payment Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -4418,6 +4427,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Pricing Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -4939,6 +4949,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Product Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -5629,6 +5640,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Promotion Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -6023,6 +6035,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Region Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -6223,6 +6236,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Sales Channel Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -6399,6 +6413,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Stock Location Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -6583,6 +6598,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Store Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -6759,6 +6775,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "Tax Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
@@ -7071,6 +7088,7 @@ export const generatedSidebar = [
|
||||
"isPathHref": true,
|
||||
"type": "category",
|
||||
"title": "User Module",
|
||||
"initialOpen": false,
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
|
||||
@@ -16,6 +16,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "API Key Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -89,6 +90,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Auth Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -198,6 +200,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Cart Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -279,6 +282,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Currency",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -345,6 +349,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Customer",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -416,6 +421,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Fulfillment Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -509,6 +515,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Inventory Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -586,6 +593,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Order Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -688,6 +696,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Payment Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -807,6 +816,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Pricing Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -894,6 +904,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Product Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -966,6 +977,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Promotion Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -1054,6 +1066,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Region Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -1120,6 +1133,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Sales Channel Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -1193,6 +1207,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Stock Location Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -1267,6 +1282,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Store Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -1333,6 +1349,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "Tax Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
@@ -1419,6 +1436,7 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
{
|
||||
type: "category",
|
||||
title: "User Module",
|
||||
initialOpen: false,
|
||||
children: [
|
||||
{
|
||||
type: "link",
|
||||
|
||||
Reference in New Issue
Block a user