Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix broken internal links #462

Merged
merged 3 commits into from
Oct 10, 2023

Conversation

indirectlylit
Copy link
Contributor

@indirectlylit indirectlylit commented Oct 4, 2023

Description

  • add validator for internal link URLs
  • fix broken links

Issue addressed

Follow-up from #423

Many instances of DocsInternalLink were broken on the Netlify deployed site. This wasn't obvious because the links worked fine from the dev server. The difference is because Netlify adds a trailing slash to all URLs:
https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash

Found instances with regex: <DocsInternalLink(.|\n)*?href="[^/]

Before/after screenshots

before after
2023-10-04 06 54 54 2023-10-04 06 59 56

Steps to test

Check links on netlify vs locally

Reviewer guidance

  • Is the code clean and well-commented?
  • Are there tests for this change?
  • Are all UI components LTR and RTL compliant (if applicable)?
  • Add other things to check for here

@MisRob
Copy link
Member

MisRob commented Oct 5, 2023

Thank you, @indirectlylit :)!

@MisRob MisRob self-requested a review October 5, 2023 07:45
@MisRob MisRob added category: supporting code Implementation of the system TODO: needs review Waiting for review labels Oct 6, 2023
@@ -26,6 +26,9 @@
href: {
type: String,
required: true,
validator(value) {
return value.startsWith('/') || value.startsWith('#');
Copy link
Member

Choose a reason for hiding this comment

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

Nice, thanks!

Copy link
Member

@MisRob MisRob left a comment

Choose a reason for hiding this comment

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

All good, thanks @indirectlylit, good to see you around :)

@MisRob MisRob merged commit a3fe298 into learningequality:release-v1.5.x Oct 10, 2023
8 checks passed
@indirectlylit
Copy link
Contributor Author

my pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: supporting code Implementation of the system TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants