@@ -145,22 +145,12 @@ const pageJumpToLinks: JumpToLink[] = jumpCategoryData
145
145
label: categoryItem .name as string ,
146
146
url: ` #${categoryItem .name } ` ,
147
147
}))
148
- .filter ((link , index ) => {
148
+ .filter ((link , index ) => {
149
149
if (link .label === undefined ) {
150
- // When categoryData.length is 1 (e.g., on /reference/p5.sound/),
151
- // jumpCategoryData is [mainCategory, ...mainCategory.subcats].
152
- // The first subcategory often has an undefined name and represents general entries
153
- // listed directly under the main category heading.
154
- // jumpCategoryData[0] links to the main category (e.g., "p5.sound" -> "#p5.sound").
155
- // jumpCategoryData[1] would be this link with an undefined label.
156
- // Since its content is covered by the main category link, this link is redundant.
157
- if (categoryData .length === 1 && index === 1 ) {
158
- return false ; // Remove this redundant link
159
- }
160
- // Fallback for any other unexpected undefined labels from this layout.
161
- // This ensures no link generated by this logic is truly empty.
162
- // A more descriptive label should ideally be formed if these cases are known.
163
- link .label = uiTranslations [" Details" ] || " Details" ;
150
+ return false ; // Completely remove all undefined labels
151
+ }
152
+ if (categoryData .length === 1 && index === 1 ) {
153
+ return false ; // Specifically remove the redundant subcat under main cat
164
154
}
165
155
return true ;
166
156
});
0 commit comments