Skip to content

Commit e8ba331

Browse files
committed
Fixes
1 parent 518aa40 commit e8ba331

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

  • packages

packages/site/content/components/primer/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: Primer
33
description: Using custom Primer components in your pages
44
show-tabs: true
5-
tab-label: Overview
65
thumbnail: /images/placeholder-1200x630.png
76
thumbnail_darkMode: /images/placeholder-1200x630-dark.png
87
---

packages/theme/components/layout/root-layout/Theme.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,18 @@ export function Theme({pageMap, children}: ThemeProps) {
152152
{activePath.reduce((acc, item, index, items) => {
153153
const nextItem = items[index + 1]
154154

155-
// Skip duplicate item for index pages without tab-label
155+
// Skip items in these cases:
156+
// 1. When current item is a folder followed by its index page
157+
// 2. When current item is an index page with a tab-label
156158
if (
157-
index < items.length - 1 &&
158-
nextItem.name === 'index' &&
159-
item.route === nextItem.route &&
160-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
161-
!nextItem.frontMatter?.['tab-label']
159+
(index < items.length - 1 &&
160+
nextItem.name === 'index' &&
161+
item.route === nextItem.route &&
162+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
163+
!nextItem.frontMatter?.['tab-label']) ||
164+
(item.name === 'index' &&
165+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
166+
item.frontMatter?.['tab-label'])
162167
) {
163168
return acc
164169
}

0 commit comments

Comments
 (0)