Skip to content

docs: Add trailing slashes to relative internal links - #19675

Merged
coolguyzone merged 1 commit into
masterfrom
coolguyzone/chore/fix-relative-inlinks
Oct 2, 2026
Merged

coolguyzone merged 1 commit into
masterfrom
coolguyzone/chore/fix-relative-inlinks

Conversation

@coolguyzone

@coolguyzone coolguyzone commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

This work was done programmatically using Claude; I have gone through the list of links and confirmed that they make sense (and our 404 catcher would catch any that break).

Stacked on #19639. Base is coolguyzone/chore/fix-trailing-slash-inlinks, so the diff here is only the relative-link delta. Merge #19639 first and this will retarget to master cleanly.

#19639 fixed root-relative links (/product/issues). It missed relative ones (../tags, ./sibling, okta-scim), which turned out to be the larger bucket. This finishes the job.

Relative links resolve in the browser, against the current page, and are requested verbatim — nothing in the MDX pipeline rewrites them. So a missing trailing slash is still a 308. The live site proves it:

https://docs.sentry.io/platforms/apple/enriching-events/context/
  renders  href="../tags"                                     -> 308
  renders  href="/platforms/apple/enriching-events/tags/"      -> 200   (same destination)

Both forms sit on the same page, pointing at the same doc.

  • 1,080 relative links across 83 files in docs/, includes/ and platform-includes/
  • Covers parent-relative (../tags), same-directory (./sibling) and bare (okta-scim) forms, in markdown links and href/to/url attributes
  • Also fixes 6 pre-existing double-slash links, which redirect for the same reason:
    /security-legal-pii/scrubbing//server-side-scrubbing/  -> 308
    /security-legal-pii/scrubbing/server-side-scrubbing/   -> 200
    

How this was found

The check-pr (lychee) log on #19639. Its [EXCLUDED] lines are internal links skipped by design — but that dump doubles as a full inventory of every internal link, and it showed URLs like https://docs.sentry.io/attachment-scrubbing with no trailing slash. Those traced back to [Attachment Scrubbing](../attachment-scrubbing), a form the linter never matched.

A full audit of link forms across the docs surface:

Form Count Before Now
absolute /foo 5,364 ✅ #19639 ✅
external http(s) 4,247 ✅ ignored ✅
relative ../foo ./foo 2,385 ❌ missed ✅ this PR
bare anchor #foo 864 ✅ ignored ✅
bare relative foo/bar 84 ❌ missed ✅ this PR

Verification

  • Generated with the linter from chore: Add a linter and autofixer for missing trailing slashes #19666, extended to cover these forms — so the tooling and the content agree by construction.
  • Every changed file differs from its parent only by added / characters: no slash removed, no external URL altered, no other content touched.
  • Resolved relative destinations spot-checked against production all return 200.

Left alone

Same carve-outs as #19639 — versioned __vX.Y.Z pages (which invert the rule), asset paths, and fenced code. Plus one new one worth calling out: angle-bracket autolinks whose URL contains parentheses, e.g. [`main()`](<https://developer.apple.com/documentation/swiftui/app/main(_:)>). A naive bare-relative match swallows those and corrupts the URL; site paths never contain (, < or >, so those characters are excluded. That removed 15 false positives, and there's a regression test for it.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace YYYY-MM-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've supplied a deadline.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Oct 1, 2026 6:49pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Oct 1, 2026 6:49pm UTC

Request Review

@coolguyzone
coolguyzone removed request for a team October 1, 2026 18:33
Follow-up to #19639, which covered root-relative links only. Relative
links resolve in the browser against the current page and are requested
verbatim, so a missing slash is still a 308. docs.sentry.io renders
`href="../tags"` today, and that request redirects to `.../tags/` --
often on the same page as a correctly-written absolute link to the very
same destination.

Covers 1080 relative links across 83 files in docs/, includes/ and
platform-includes/: parent-relative (`../tags`), same-directory
(`./sibling`) and bare (`okta-scim`) forms, in markdown links and in
href/to/url attributes.

Also fixes 6 pre-existing double-slash links, which redirect for the
same reason:
  /security-legal-pii/scrubbing//server-side-scrubbing/  -> 308
  /security-legal-pii/scrubbing/server-side-scrubbing/   -> 200

Generated with the linter from #19666. Verified: every changed file
differs from master only by added "/" characters, apart from the three
double-slash files, which remove one by design; no external URL is
altered; resolved destinations spot-checked against production return
200.

Left alone, as in #19639: versioned `__vX.Y.Z` pages, which invert the
rule; asset paths; fenced code; and angle-bracket autolinks whose URLs
contain parentheses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coolguyzone
coolguyzone merged commit 069ee94 into master Oct 2, 2026
26 checks passed
@coolguyzone
coolguyzone deleted the coolguyzone/chore/fix-relative-inlinks branch October 2, 2026 17:32
coolguyzone added a commit that referenced this pull request Oct 5, 2026
## DESCRIBE YOUR PR

The last bucket from the trailing-slash work in #19639 and #19675, which
covered only the user docs.

`develop-docs/` renders at **develop.sentry.dev** from the same Next
config, so the same rule applies — a link without a trailing slash is
served a 308 before the page loads:

```
https://develop.sentry.dev/backend/application-domains   -> 308
https://develop.sentry.dev/backend/application-domains/  -> 200
```

**240 links across 39 files**, produced by `pnpm
lint:trailing-slash:fix` from #19666. No hand edits.

### Verification

- Every changed file differs from master **only by added `/`
characters** — no slash removed, no external URL altered, no other
content touched
- A sample of 25 rewritten destinations all return **200** on
develop.sentry.dev
- `pnpm lint:trailing-slash` is now clean for `develop-docs/`

The 23 violations the linter still reports are drift in `docs/`, fixed
separately in #19811.

> Note: `AGENTS.md` describes `develop-docs/` as a submodule, but it
isn't one — `git submodule status` is empty and the directory has direct
commits in this repo. Worth correcting in that file at some point,
though I've left it out of this PR.

## IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
supplied a deadline.

Thanks in advance for your help!

## PRE-MERGE CHECKLIST

_Make sure you've checked the following before merging your changes:_

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – sentry-docs — 83751728 Deployed Oct 1, 2026 by vercel[bot]
Preview – develop-docs — f3d97275 Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants