Skip to content

feat(links): open external links in a new tab#52

Merged
drknowhow merged 1 commit into
mainfrom
feat/external-links-new-tab
Jun 19, 2026
Merged

feat(links): open external links in a new tab#52
drknowhow merged 1 commit into
mainfrom
feat/external-links-new-tab

Conversation

@drknowhow

Copy link
Copy Markdown
Owner

Every anchor that points off-site now opens in a new tab with rel="noopener noreferrer" (security: a new-tab link must not give the opened page window.opener access). Internal links — relative, #anchors, and absolute toolspace.yepgent.com URLs — stay in the same tab.

Implementation: one idempotent helper, scripts/_external_links.py (mark_external_links), hooked into both page generators (build_registry_pages, build_changelog_page) and run once over the three hand-authored static pages (index, publish/, case-study/muninn/). "External" = an absolute http(s) URL whose host is not toolspace.yepgent.com.

  • Idempotent — anchors that already declare target= are skipped; rel is merged order-independently. Safe to re-run every build.
  • Registry pages regenerated with timestamps pinned to committed values, so the diff is the target/rel change only — no "Pages generated" churn (verified: per-file changed lines == external-anchor count).
  • build_registry_pages.py --check + build_changelog_page.py --check pass; full pytest suite green (36 passed).

🤖 Generated with Claude Code

Every anchor that points off-site now opens in a new tab with
rel="noopener noreferrer" (security: a new-tab link must not hand the
opened page window.opener access). Internal links — relative, #anchors,
and absolute toolspace.yepgent.com URLs — are left in the same tab.

Implementation is a single idempotent helper, scripts/_external_links.py
(mark_external_links), hooked into both page generators
(build_registry_pages, build_changelog_page) and run once over the three
hand-authored static pages (index, publish, case-study/muninn). "External"
= an absolute http(s) URL whose host is not toolspace.yepgent.com.

Idempotent: anchors that already declare target= are skipped and rel is
merged order-independently, so it is safe to re-run every build. Registry
pages were regenerated with timestamps pinned to the committed values, so
the diff is the target/rel change only — no "Pages generated" churn.

build_registry_pages.py --check and build_changelog_page.py --check both
pass; full pytest suite green (36 passed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@drknowhow drknowhow merged commit 9a99782 into main Jun 19, 2026
7 checks passed
@yepgent yepgent deleted the feat/external-links-new-tab branch June 19, 2026 09:47
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