Skip to content

fix: replace native <a> with next/link for correct basePath routing

刘福春 requested to merge fix/install-url into main

Summary

  • Replace native <a href="/docs"> with <Link href="/docs"> in the main navigation
  • Replace native <a href="/"> with <Link href="/"> on the docs home page
  • Native <a> tags bypass Next.js basePath: '/gmskills', causing navigation links to redirect to the wrong URL

Root cause

Next.js Link component automatically prepends basePath to relative paths. Native <a> tags do not, so clicking "文档" redirected to /docs instead of /gmskills/docs.

Test plan

  • Click "文档" button on the main page → should navigate to /gmskills/docs
  • Click "回到首页" link in the docs page → should navigate back to /gmskills/
  • Verify docs internal links (Link components) still work correctly

🤖 Generated with Claude Code

Merge request reports