diff --git a/docusaurus.config.js b/docusaurus.config.js index e2c8f2a171d..9dd280def4a 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -2,7 +2,7 @@ // Note: type annotations allow type checking and IDEs autocompletion require("dotenv").config(); -const { fetchAndGenerateSidebarItems } = require("./src/helpers"); +const { fetchAndGenerateDynamicSidebarItems } = require("./src/helpers"); import { NETWORK_NAMES } from "./src/lib/constants.ts"; const upperFirst = require("lodash.upperfirst"); const { themes } = require("prism-react-renderer"); @@ -131,7 +131,7 @@ const config = { sidebarItemsGenerator: async function ({ defaultSidebarItemsGenerator, ...args }) { config.customFields.sidebarData = args; let sidebarItems = await defaultSidebarItemsGenerator(args); - const dynamicSidebarItems = await fetchAndGenerateSidebarItems(NETWORK_NAMES.linea); + const dynamicSidebarItems = await fetchAndGenerateDynamicSidebarItems(NETWORK_NAMES.linea); config.customFields.dynamicData = dynamicSidebarItems; const updatedItems = sidebarItems.map(item => { if (item?.label === upperFirst(NETWORK_NAMES.linea) && item?.items) { diff --git a/src/components/CustomReferencePage/index.tsx b/src/components/CustomReferencePage/index.tsx index 4dd1fefe178..14ede8036bc 100644 --- a/src/components/CustomReferencePage/index.tsx +++ b/src/components/CustomReferencePage/index.tsx @@ -39,16 +39,14 @@ function generateSidebarItems(docs) { label: upperFirst(doc.frontMatter?.sidebar_label || doc.frontMatter?.title || part), collapsed: false, collapsible: true, - link: { - type: 'generated-index', - slug: pathParts.slice(0, index + 1).join('/') - }, + href: `/services/reference`, items: [] }; } else { currentCategory[part] = { type: 'category', label: upperFirst(part), + href: `/services/${doc.sourceDirName}`, collapsed: part !== "Get started", collapsible: true, items: [] diff --git a/src/helpers/index.ts b/src/helpers/index.ts index db007ae57bb..6b4bb60f480 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -1,6 +1,6 @@ import { RPC_NETWORK_URL } from "../lib/constants"; -export const fetchAndGenerateSidebarItems = async (networkName) => { +export const fetchAndGenerateDynamicSidebarItems = async (networkName) => { try { const response = await fetch(`${RPC_NETWORK_URL}/${networkName}`); const data = await response.json(); @@ -13,6 +13,10 @@ export const fetchAndGenerateSidebarItems = async (networkName) => { { type: "category", label: "JSON-RPC Methods NEW", + link: { + type: 'generated-index', + slug: "/services/reference/linea/json-rpc-methods-new/" + }, collapsed: true, collapsible: true, items: dynamicItems,