Skip to content

Commit 649c091

Browse files
reshma045ksen0
authored andcommitted
Update ReferenceLayout.astro
1 parent 5fe15be commit 649c091

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/layouts/ReferenceLayout.astro

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,12 @@ const pageJumpToLinks: JumpToLink[] = jumpCategoryData
145145
label: categoryItem.name as string,
146146
url: `#${categoryItem.name}`,
147147
}))
148-
.filter((link, index) => {
148+
.filter((link, index) => {
149149
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
164154
}
165155
return true;
166156
});

0 commit comments

Comments
 (0)