Skip to content

Open external links in a new tab - #32

Merged
gronnerup merged 1 commit into
mainfrom
gronnerup/external-links-new-tab
Aug 17, 2026
Merged

Open external links in a new tab#32
gronnerup merged 1 commit into
mainfrom
gronnerup/external-links-new-tab

Conversation

@gronnerup

Copy link
Copy Markdown
Owner

Summary

Community request: external links in the catalog (Visit, and links generally) should open in a new browser tab instead of navigating away from the catalog.

Changes

  • Added a small script in BaseLayout that flags every <a> pointing to a different origin with target="_blank" and rel="noopener noreferrer". One place, so it covers the Visit/Docs/Source actions, footer links (GitHub, CC-BY), the about/submit links, and links inside rendered tool descriptions.
  • Internal links (tool/category pages, RSS, API) are unaffected and stay in the same tab.

Verification

  • npx astro check -> 0 errors/warnings/hints.
  • npm run build passes; confirmed the script ships inlined on home, tool-detail, and about pages.

Notes

  • Chose a single origin-based script over editing every anchor: DRY, and it also handles external links inside markdown tool descriptions (which per-template edits would miss). Degrades gracefully without JS (links still work, same tab).

@gronnerup
gronnerup merged commit 7760b75 into main Aug 17, 2026
1 check passed
@gronnerup
gronnerup deleted the gronnerup/external-links-new-tab branch August 17, 2026 13:11
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.

1 participant