diff --git a/plugins/processor/site.mjs b/plugins/processor/site.mjs index 638aba73..48a695b0 100644 --- a/plugins/processor/site.mjs +++ b/plugins/processor/site.mjs @@ -9,10 +9,16 @@ const SIDEBAR_GROUP_NAME = 'API'; const getFirstAtxHeading = text => text.match(/^#\s+(.+)$/m)?.[1]?.trim(); -const getFirstPathSegment = url => url.replace(/^\//, '').split('/')[0]; +const getPathSegments = url => url.replace(/^\//, '').split('/'); + +const getFirstPathSegment = url => getPathSegments(url)[0]; + +const getPathDepth = url => getPathSegments(url).length; const defaultLabelFor = (target, url) => { - if (url.endsWith('/index.md')) return 'Overview'; + if (url.endsWith('/index.md')) { + return getPathDepth(url) === 2 ? 'Overview' : target.name; + } if (url.endsWith('/types.md')) return 'Types'; return target.name; }; diff --git a/plugins/shared/categories.mjs b/plugins/shared/categories.mjs index 06dadc96..7af9d9b5 100644 --- a/plugins/shared/categories.mjs +++ b/plugins/shared/categories.mjs @@ -8,6 +8,26 @@ export const CATEGORY_RULES = [ label: 'Optimization', match: reflection => /^optimize\./i.test(reflection.getFullName()), }, + { + category: 'container', + label: 'Container', + }, + { + category: 'debug', + label: 'Debug', + }, + { + category: 'experiments', + label: 'Experiments', + }, + { + category: 'ids', + label: 'IDs', + }, + { + category: 'javascript', + label: 'JavaScript', + }, { category: 'plugins', label: 'Plugins',