@primer/doctocat-nextjs 0.0.0-20250625130205 → 0.0.0-20250626090518

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # @primer/doctocat-nextjs
2
2
 
3
- ## 0.0.0-20250625130205
3
+ ## 0.0.0-20250626090518
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Fake entry to force publishing
8
8
 
9
- ## 0.0.0-20250625130203
9
+ ## 0.5.4
10
10
 
11
11
  ### Patch Changes
12
12
 
13
- - [#51](https://github.com/primer/doctocat-nextjs/pull/51) [`b0e2e2a`](https://github.com/primer/doctocat-nextjs/commit/b0e2e2ae3b6c5f61f3de8e40eecb789e577fb8a3) Thanks [@rezrah](https://github.com/rezrah)! - Add auto-collapsed React code blocks for large code snippets. This feature only applies to code fences with the `jsx live` language identifiers.
13
+ - [#51](https://github.com/primer/doctocat-nextjs/pull/51) [`4c76c4f`](https://github.com/primer/doctocat-nextjs/commit/4c76c4f5ccd248ec7d1f448c054808287a3ff51d) Thanks [@rezrah](https://github.com/rezrah)! - Add auto-collapsed React code blocks for large code snippets. This feature only applies to code fences with the `jsx live` language identifiers.
14
14
 
15
15
  E.g.
16
16
 
@@ -149,22 +149,40 @@ export function Theme({pageMap, children}: ThemeProps) {
149
149
  {activeHeaderLink ? activeHeaderLink.title : siteTitle}
150
150
  </Breadcrumbs.Item>
151
151
  )}
152
- {activePath.map((item, index) => {
153
- return (
152
+ {activePath.reduce((acc, item, index, items) => {
153
+ // Skip duplicate item for index pages without tab-label
154
+ if (
155
+ index > 0 &&
156
+ item.route === items[index - 1].route &&
157
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
158
+ !item.frontMatter?.['tab-label']
159
+ ) {
160
+ return acc
161
+ }
162
+
163
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
164
+ const itemTitle = item.frontMatter?.['tab-label'] || item.title
165
+ const isLastItem = index === items.length - 1
166
+
167
+ acc.push(
154
168
  <Breadcrumbs.Item
155
169
  as={NextLink}
156
- key={item.name}
170
+ key={`${item.name}-${index}`}
157
171
  href={item.route}
158
- selected={index === activePath.length - 1}
172
+ selected={isLastItem}
159
173
  sx={{
160
174
  textTransform: 'capitalize',
161
175
  color: 'var(--brand-InlineLink-color-rest)',
176
+ pointerEvents: isLastItem ? 'none' : undefined,
177
+ cursor: isLastItem ? 'default' : undefined,
162
178
  }}
163
179
  >
164
- {item.title.replace(/-/g, ' ')}
165
- </Breadcrumbs.Item>
180
+ {itemTitle.replace(/-/g, ' ')}
181
+ </Breadcrumbs.Item>,
166
182
  )
167
- })}
183
+
184
+ return acc
185
+ }, [] as React.ReactNode[])}
168
186
  </Breadcrumbs>
169
187
  )}
170
188
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/doctocat-nextjs",
3
- "version": "0.0.0-20250625130205",
3
+ "version": "0.0.0-20250626090518",
4
4
  "description": "A Next.js theme for building Primer documentation sites",
5
5
  "main": "index.js",
6
6
  "type": "module",