Repository navigation
feat: 301 redirect ds*->on* on dataset detail page - #18
Merged
neuromechanist merged 1 commit intoMay 18, 2026
Merged
neuromechanist merged 1 commit into
neuromechanist merged 1 commit into
Conversation
OpenNeuro source ids (ds*) now redirect to their NEMAR canonical (on*) when a mirror exists in the catalog. /dataset/ds002718 lands on /dataset/on002718 with the query string preserved; ds* without a mirror fall through to the existing 404 path. Adds resolveCanonical() helper around /datasets/resolve/:id with null fallback on non-2xx so a transient backend failure leaves the request on the original id instead of erroring. Refs #17
Deploying nemar-website with
|
| Latest commit: |
549c26a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d467e896.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-issue-17-ds-on-redir.nemar-website.pages.dev |
neuromechanist
merged commit May 18, 2026
03cf9b4
into
feature/issue-1-epic-nemar-redesign
1 check passed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17
Summary
OpenNeuro source ids (
ds*) now redirect to their NEMAR canonical (on*) when a mirror exists in the catalog. Deep links from OpenNeuro, search engines, and any pre-existing references to the OpenNeuro id land on the canonical NEMAR page instead of 404ing.Changes
src/lib/api.ts: newresolveCanonical(sourceId)around/datasets/resolve/:id. Returnsnullon non-2xx so a transient backend failure leaves the request on the original id rather than erroring.src/pages/dataset/[id].astro: when the param matches^ds\d{6}$, callresolveCanonicaland 301 to/dataset/<canonical><query>when found.src/lib/api.test.ts: four new tests (mirror found, found=false, non-2xx, url-encoding).Local verification
bun run test-> 73/73 (4 new)bun run typecheck-> 0 errorsbun run build-> cleanOut of scope (separate issues)