docs: improve main docs and resources sidebar (#8664)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-08-20 12:31:50 +02:00
1 parent bc19a9162a
commit 1020ab0b97
5 files changed
+46 -1

No files matched your search

+5
View File
@@ -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",
+1
View File
@@ -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
+4 -1
View File
@@ -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,