Skip to content

Conversation

@dynamicdhxx
Copy link

Description

Fixes the table of contents functionality on blog pages. TOC items now properly scroll to their corresponding sections when clicked.

Changes

  • Fixed ID mismatch between TOC items and heading elements
  • TOC items now use sanitized IDs that match heading element IDs
  • Added cursor-pointer class for better UX
  • Updated handleItemClick to use sanitized IDs correctly
  • Fixed dropdown click handler to use correct ID format

Testing

  • Tested locally on blog pages
  • TOC items now properly scroll to sections when clicked
  • URL hash updates correctly
  • Works on both desktop and mobile views

Issue

The table of contents showed pointer cursor on hover but clicking did nothing. This was due to ID mismatch between TOC items (using raw text) and heading elements (using sanitized IDs).

- Fixed ID mismatch between TOC items and heading elements
- TOC items now use sanitized IDs that match heading element IDs
- Added cursor-pointer class for better UX
- Updated handleItemClick to use sanitized IDs correctly
- Fixed dropdown click handler to use correct ID format
- Table of contents items now properly scroll to their sections when clicked

Fixes table of contents navigation on blog pages

Signed-off-by: Dhruv Bharuka <iit2022015@iiitl.ac.in>
- Fixed ID mismatch between TOC items and heading elements
- TOC items now use sanitized IDs that match heading element IDs
- Added cursor-pointer class for better UX
- Updated handleItemClick to use sanitized IDs correctly
- Fixed dropdown click handler to use correct ID format
- Table of contents items now properly scroll to their sections when clicked

Fixes table of contents navigation on blog pages

Signed-off-by: Dhruv Bharuka <iit2022015@iiitl.ac.in>
@amaan-bhati amaan-bhati self-requested a review January 5, 2026 19:14
Copy link
Member

@amaan-bhati amaan-bhati left a comment

Choose a reason for hiding this comment

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

Hey @dynamicdhxx Thanks for raising this pr, before i get to review this locally, can you please take a look at the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants