Skip to content

Commit 8526167

Browse files
authored
fix(): exclude custom subsections (#7298)
1 parent 28fbacd commit 8526167

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"className": "hidden-sidebar"
2+
"className": "hidden-sidebar",
3+
4+
"customProps": { "hide_from_subsection": true }
35
}

src/theme/DocCardList/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export default function DocCardList(props: Props): JSX.Element {
1919
}
2020
const [filteredItems, setFilteredItems] = useState<any>(filterDocCardListItems(items));
2121
useEffect(() => {
22-
setFilteredItems(filteredItems.filter((e: any) => e?.href?.slice(0, -1) !== location.pathname));
22+
setFilteredItems(prevFilteredItems =>
23+
prevFilteredItems
24+
.filter((e: any) => e?.href?.slice(0, -1) !== location.pathname)
25+
.filter((e: any) => !e?.customProps?.hide_from_subsection)
26+
);
2327
}, [items]);
2428
return (
2529
<section className={clsx("row", className)}>

0 commit comments

Comments
 (0)