Skip to content

Commit

Permalink
[docs infra] fix changelog's On This Page (#6706)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan committed Feb 23, 2022
1 parent 38b8283 commit e602e45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/next/components/mdx/SidebarNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const renderItems = (items, activeId, depth) => {
return (
<ol>
{items.map((item) => {
return (
return item.url ? (
<li key={item.url} className={cx(MARGINS[depth], "mt-3 list-inside")}>
<a
href={item.url}
Expand All @@ -125,6 +125,8 @@ const renderItems = (items, activeId, depth) => {
</a>
{item.items && renderItems(item.items, activeId, depth + 1)}
</li>
) : (
renderItems(item.items, activeId, depth)
);
})}
</ol>
Expand Down
6 changes: 4 additions & 2 deletions docs/next/pages/changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ function MDXRenderer({ data }: { data: MDXData }) {
},
});

const navigationItems = tableOfContents.items.filter((item) => item?.items);

return (
<>
<NextSeo
Expand Down Expand Up @@ -140,8 +142,8 @@ function MDXRenderer({ data }: { data: MDXData }) {
On this page
</div>
<div className="mt-6 ">
{tableOfContents.items[0].items && (
<SidebarNavigation items={tableOfContents.items[0].items} />
{navigationItems && (
<SidebarNavigation items={navigationItems} />
)}
</div>
</div>
Expand Down

1 comment on commit e602e45

@vercel
Copy link

@vercel vercel bot commented on e602e45 Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.