Skip to content

Commit

Permalink
fix: toc links in the blogs (#3562)
Browse files Browse the repository at this point in the history
Co-authored-by: Ansh Goyal <[email protected]>
  • Loading branch information
r3yc0n1c and anshgoyalevil authored Jan 27, 2025
1 parent eda1544 commit a02ddc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/TOC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe
</div>
<div className={`${!open && 'hidden'} ${cssBreakingPoint === 'xl' ? 'xl:block' : 'lg:block'}`}>
<Scrollspy
items={tocItems.map((item) => item.slug)}
items={tocItems.map((item) => (item.slug ? item.slug : item.slugWithATag))}
currentClassName='text-primary-500 font-bold'
componentTag='div'
rootEl={contentSelector}
Expand All @@ -85,7 +85,7 @@ export default function TOC({ className, cssBreakingPoint = 'xl', toc, contentSe
<a
className={`pl-${2 ** (item.lvl - 1)} font-normal mb-1 block font-sans text-sm
text-gray-900 antialiased transition duration-100 ease-in-out hover:underline`}
href={`#${item.slug}`}
href={`#${item.slug ? item.slug : item.slugWithATag}`}
key={index}
data-testid='TOC-Link'
>
Expand Down

0 comments on commit a02ddc2

Please sign in to comment.