Skip to content

[BUG] Mobile navbar section links are broken on non-home pages #32

@Boopana-M

Description

@Boopana-M

Mobile hamburger menu uses hash-only links (#subjects, #contribute, #sponsor). When clicked from non-home routes (eg. semester/subject pages) they resolve on the current page instead of navigating to the homepage sections, breaking core navigation on mobile.

Steps to reproduce:
->Open a non-home page (for example /sem1/c).
->Narrow the browser to a mobile viewport (eg. width < 768px).
->Open the hamburger menu and tap SUBJECTS / CONTRIBUTE / SPONSOR.

Actual: URL becomes current-route + hash (e.g. /sem1/c#subjects) and the expected homepage section is not shown.
Expected: Menu links should navigate to the homepage and scroll to the section (eg. /#subjects, /#contribute, /#sponsor) and the mobile menu should close.

Code evidence:
->Desktop menu uses absolute homepage anchors: [navbar.tsx]
->Mobile menu uses hash-only links: [navbar.tsx]
->[Navbar] is included on non-home layouts (example): [layout.tsx]

Root cause: Inconsistent values between desktop and mobile menus in [navbar.tsx] (desktop uses "/#..." while mobile uses "#..."), causing relative navigation when the current route is not the homepage.

Proposed fix: Update mobile menu hrefs to use absolute homepage anchors:
/#subjects
/#contribute
/#sponsor
(menu already closes on click; ensure navigation still triggers close behavior)

Acceptance criteria:
Mobile menu links navigate to the correct homepage sections from any route.
Behavior matches desktop menu.
Mobile menu closes after navigation.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggssoc-26Part of GirlScript Summer of Code 2026gssoc:approvedApproved for GSSOC '26level:beginner

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions