Skip to content

Enforce root-relative URL syntax and open links in new tabs - #142

Open
httphypixelnet wants to merge 5 commits into
frcsoftware:mainfrom
httphypixelnet:feat/external-links
Open

Enforce root-relative URL syntax and open links in new tabs#142
httphypixelnet wants to merge 5 commits into
frcsoftware:mainfrom
httphypixelnet:feat/external-links

Conversation

@httphypixelnet

Copy link
Copy Markdown
Contributor

Description

Added

  • rehype-external-links.ts: Rehype plugin to ensure external links open in a new tab
  • remark-force-root-relative.mjs: Remark plugin to enforce root-relative URLs on internal links

Closes #37

Meta

Merge checklist:

@httphypixelnet
httphypixelnet requested a review from a team as a code owner July 27, 2026 23:36
@github-actions github-actions Bot added Curriculum material Curriculum materials, lessons for students, etc stage1 infra Any infrastructure for building the website or syncing files labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown

🌐 Preview URL: https://pr-142.frcsoftware.pages.dev

@samfreund

samfreund commented Jul 27, 2026

Copy link
Copy Markdown
Member

I believe absolute links is covered by af64f50

I misinterpreted the purpose of the absolute links

@httphypixelnet

Copy link
Copy Markdown
Contributor Author

I believe absolute links is covered by af64f50

The current lint/build tooling doesn't fail on src/content/docs/learning-course/stage1/stage1b/stage-overview.mdx so I'm going to assume it does not cover absolute links.

@samfreund

Copy link
Copy Markdown
Member

I believe absolute links is covered by af64f50

The current lint/build tooling doesn't fail on src/content/docs/learning-course/stage1/stage1b/stage-overview.mdx so I'm going to assume it does not cover absolute links.

It does, I think the reason that doesn't work is because src/content/etc. is the root path. Haven't tested with that combination though, so can't confirm. Regardless, it doesn't cover some of the https links you're changing so that's a good fix.

Comment thread src/plugins/rehype-external-links.ts
@httphypixelnet

Copy link
Copy Markdown
Contributor Author

Strange, you want me to investigate making the plugin work properly?

@httphypixelnet
httphypixelnet requested a review from samfreund July 28, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Curriculum material Curriculum materials, lessons for students, etc infra Any infrastructure for building the website or syncing files stage1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External Links Handler

2 participants