Skip to content

refactor: replace anchor tags with Next.js Link components - #5

Merged
stevenzg merged 1 commit into
mainfrom
claude/troubleshooting-question-qg139c
Jul 16, 2026
Merged

refactor: replace anchor tags with Next.js Link components#5
stevenzg merged 1 commit into
mainfrom
claude/troubleshooting-question-qg139c

Conversation

@stevenzg

Copy link
Copy Markdown
Owner

Summary

Replace internal anchor tags (<a> elements) with Next.js Link components for internal navigation routes. This improves performance by enabling client-side navigation and prefetching for links to /docs pages.

Three internal navigation links are updated:

  • Navigation bar "Docs" link
  • Hero section "Get started" button
  • Call-to-action section "Read the docs" button

External links (GitHub) remain as anchor tags since they navigate outside the application.

Type of change

  • Bug fix (fix)
  • New feature (feat)
  • Refactor / cleanup (refactor / chore)
  • Docs (docs)
  • CI / build (ci / build)

Checklist

  • make check passes locally (fmt, vet, lint, race tests + coverage gate).
  • Added or updated tests for the change.
  • Updated CHANGELOG.md under ## [Unreleased] (if user-visible).
  • Commits follow Conventional Commits.
  • Touched OS-specific code? Verified the cross-compile matrix builds.

Notes for reviewers

This is a straightforward refactor that improves the user experience by leveraging Next.js's built-in Link component for internal navigation. The change maintains the same styling and functionality while enabling client-side transitions and automatic prefetching of linked pages.

https://claude.ai/code/session_01MoUvg2Lio7NF4dAr1bsUR2

The landing page linked to the docs with plain <a href="/docs"> tags.
Next.js only prepends basePath ("/tarjan" on GitHub Pages) to next/link
<Link>, not to raw anchors, so "Get started", the nav "Docs" link, and
"Read the docs" all pointed at /docs and 404'd on the deployed site.

Switch those three internal links to <Link>; the in-page #features anchor
and external GitHub links stay as <a>. Verified a production build with
PAGES_BASE_PATH=/tarjan emits href="/tarjan/docs/" for all three.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MoUvg2Lio7NF4dAr1bsUR2
@stevenzg
stevenzg merged commit bf4df20 into main Jul 16, 2026
5 checks passed
@stevenzg
stevenzg deleted the claude/troubleshooting-question-qg139c branch July 16, 2026 10:24
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