Skip to content

Make header links work on sites served from a folder, and announce new tabs - #184

Closed
matthewmr-eqty wants to merge 2 commits into
mainfrom
docs-link-rule
Closed

matthewmr-eqty wants to merge 2 commits into
mainfrom
docs-link-rule

Conversation

@matthewmr-eqty

Copy link
Copy Markdown
Contributor

Need

Sites served from a folder need header links that start with / to land inside that folder, and screen-reader users need to know when a link opens a new tab.

Problem

integrity-py's docs live at eqtylab.github.io/integrity-py/. Links in page text already get the folder added, but header links went out exactly as typed, so a header link to /latest/ sent readers to eqtylab.github.io/latest/, which doesn't exist. integrity-py works around it with full addresses. Links that open a new tab gave no warning.

Link written as /latest/ Before After
In page text /integrity-py/latest/ /integrity-py/latest/
In a header link /latest/ (broken) /integrity-py/latest/

Change

Page text's rule for adding the folder moves unchanged into paths.ts, and the header and mobile menu use it too, so both follow one rule. Sites served at the root, like this demo, see no difference. New-tab links carry hidden "(opens in a new tab)" text.

Evidence

New tests cover the folder rule, the links it leaves alone (full addresses, //, #, relative), and check that header links and page text agree at three bases. The existing page-text tests pass unchanged. Demo builds; the rendered header and menu GitHub links include the hidden text.

Not covered

No live demo of the folder rule (the demo is served at /). Not checked with a real screen reader, only in the rendered page. The footer's "Edit this page" and the "View as Markdown" button don't announce new tabs yet.

🤖 Generated with Claude Code

…w tabs

Need: header links starting with / must work on sites served from a sub-folder, and screen-reader users need to know when a link opens a new tab.
Problem: header links were written out as is, so /latest/ on integrity-py's site dropped the /integrity-py/ part, and new-tab links gave no warning.
Solution: page text's link rule now lives in paths.ts and the header and menu use it; new-tab links carry hidden "(opens in a new tab)" text.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	packages/docs/CHANGELOG.md
matthewmr-eqty added a commit that referenced this pull request Oct 7, 2026
…12.0

Need: the #184/#185/#189 stack lands on main as one PR, and main now ships Astro 7 as 0.11.0.
Problem: 0.11.0 is published, and the stack's two unreleased changelog sections contradicted each other.
Solution: the stack becomes 0.12.0 with one changelog section for the end state; the regenerated lockfile passes a frozen install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matthewmr-eqty
matthewmr-eqty removed this pull request from stack #186 October 7, 2026 20:16
@matthewmr-eqty

Copy link
Copy Markdown
Contributor Author

Landed in #189, which merged this stack into main as @eqtylab/docs 0.12.0.

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