From e3ee6e789c319f03e4bf3f7a35e8a9ec505109ea Mon Sep 17 00:00:00 2001 From: jxom <7336481+jxom@users.noreply.github.com> Date: Tue, 14 Jul 2026 12:26:48 +1000 Subject: [PATCH] docs: group top navigation links --- scripts/docgen/build.ts | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/scripts/docgen/build.ts b/scripts/docgen/build.ts index 8645d15c..22a61db8 100644 --- a/scripts/docgen/build.ts +++ b/scripts/docgen/build.ts @@ -34,7 +34,11 @@ type SidebarItem = { link?: string text: string } -type TopNav = { link: string; text: string }[] +type TopNavLink = { link: string; text: string } +type TopNav = readonly ( + | TopNavLink + | { items: readonly TopNavLink[]; text: string } +)[] console.log('Generating API docs.') @@ -622,10 +626,33 @@ for (const { entrypointCategory, categories } of namespaceEntries) { } } -const topNav: TopNav = namespaceEntries.map(({ entrypointCategory }) => ({ - text: entrypointCategory, - link: getPath({ entrypointCategory }), -})) satisfies TopNav +const topNav = [ + { + text: 'Core', + link: getPath({ entrypointCategory: 'Core' }), + }, + { + text: 'Tempo', + link: getPath({ entrypointCategory: 'Tempo' }), + }, + { + text: 'More', + items: [ + { + text: 'Account Abstraction', + link: getPath({ entrypointCategory: 'WebAuthn' }), + }, + { + text: 'ERCs', + link: getPath({ entrypointCategory: 'ERCs' }), + }, + { + text: 'Zod', + link: getPath({ entrypointCategory: 'Zod' }), + }, + ], + }, +] satisfies TopNav fs.writeFileSync( './site/src/config-generated.ts',