Skip to content

feat(cli-docs): Show a banner to visitors redirected from docs.sentry.io - #2869

Merged
BYK merged 2 commits into
mainfrom
cli-docs-redirect-banner
Dec 3, 2026
Merged

BYK merged 2 commits into
mainfrom
cli-docs-redirect-banner

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

The old docs.sentry.io /cli/* pages are moving to cli.sentry.dev, and getsentry/sentry-docs#20979 adds ?from=sentry-docs to every redirect destination. People who land here that way get a banner above the page content:

Sentry CLI docs have moved here. Coming from sentry-cli v3? Read the migration guide. Looking for v3? Its ghost haunts getsentry/sentry-cli.

  • RedirectBanner.astro holds the banner in a <template> and an inline script. When the URL has from=sentry-docs, the script inserts the banner right before <main> and removes the param from the address bar with history.replaceState, keeping other params and the hash. Nothing is stored or tracked.
  • It mounts in the existing PageFrame override, next to the analytics components. Without the param, pages render as they do today.
  • Starlight's built-in banner frontmatter is static per page, so it can't depend on the query param. Putting anything inside <main> before the content also breaks the theme's main > .content-panel:first-child spacing, which is why the banner goes above <main> instead.
  • The banner reuses the layout of Starlight's banner in the site's brand purple. The migration guide link respects the PR-preview base path.

Screenshots

/getting-started/?from=sentry-docs (address bar ends up as /getting-started/):
getting started with param

/?from=sentry-docs:
landing page with param

/getting-started/ without the param:
getting started without param

via @BYK.

--

View Session [Sentry]

The docs.sentry.io /cli/* redirects add ?from=sentry-docs to their
cli.sentry.dev destinations. With that param, a banner above the page
content says the docs moved and links the v3 migration guide and
getsentry/sentry-cli, then the param is dropped from the address bar.
Without it, the page is unchanged.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from BYK December 3, 2026 22:49
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cli Ready Ready Preview Dec 3, 2026 10:54pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Dec 3, 2026 10:54pm UTC

Request Review

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good except for "It lives" part. It doesn't live there, it's the tombstone, or obituary, or like a zombie/ghost/soul? Something fun like that. But not live.

@vercel
vercel Bot temporarily deployed to Preview – sentry-local December 3, 2026 22:53 Inactive
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: low PR risk score: low labels Dec 3, 2026
@BYK
BYK added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 33a8f8d Dec 3, 2026
20 of 21 checks passed
@BYK
BYK deleted the cli-docs-redirect-banner branch December 3, 2026 23:01

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — 25cd6764 Deployed Dec 3, 2026 by vercel[bot]
Preview – sentry-local — 25cd6764 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant