Skip to content

Commit

Permalink
fix: nav grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Aug 10, 2024
1 parent 49a502d commit 31551f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Nav({ docs, asPath }: { docs: Doc[]; asPath: string }) {
const nav = React.useMemo(
() =>
docs.reduce((acc, doc) => {
const [, ...rest] = doc.slug
const [...rest] = doc.slug
const [page, category] = rest.reverse()

if (category && !acc[category]) acc[category] = {}
Expand All @@ -43,6 +43,7 @@ function Nav({ docs, asPath }: { docs: Doc[]; asPath: string }) {
}, {} as NavList),
[docs]
)
console.log('nav', nav)

return (
<ul>
Expand Down

0 comments on commit 31551f0

Please sign in to comment.