Skip to content

fix: normalize ContributeFooter route before GitHub link#446

Open
tansawit wants to merge 2 commits intosecurity-alliance:developfrom
tansawit:fix/contribute-footer-path
Open

fix: normalize ContributeFooter route before GitHub link#446
tansawit wants to merge 2 commits intosecurity-alliance:developfrom
tansawit:fix/contribute-footer-path

Conversation

@tansawit
Copy link
Copy Markdown

@tansawit tansawit commented Apr 6, 2026

Summary

Fixes ContributeFooter.tsx URL generation to handle trailing slashes in window.location.pathname.

Problem

Routes like /intro/introduction/ were being transformed into intro/introduction/.mdx, producing invalid GitHub links (for example .../intro/introduction/.mdx).

Change

  • Normalize path from window.location.pathname by trimming leading and trailing /.
  • Avoid generating a path for / home route.
  • Result is correct: /intro/introduction/ -> intro/introduction.mdx.

Validation

  • Manual path normalization check via quick Node verification for common routes.

Frameworks PR Checklist

  • Describe your changes
  • If you are touching an existing piece of content, tag current contributors from the attribution list
  • If there is a steward for that framework, ask the steward to review it
  • If you're modifying the general outline, make sure to update it in vocs.config.ts adding the dev: true parameter
  • If you need feedback for your content from the wider community, share the PR in our Discord
  • Review changes to ensure there are no typos

Files

  • components/footer/ContributeFooter.tsx

@scode2277
Copy link
Copy Markdown
Collaborator

Hey! Thanks for the effort you put into this.
Could you provide more details on how to reproduce the bug? I tried reproducing it on my end but it seems to work all right, so I'm curious to know if I might be missing something.

Thanks again for the time and sorry you experienced issues in finding the pages on github 🙏🏻

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