Skip to content

Make navbar cross-product docs links environment-aware#73

Merged
tbantle22 merged 1 commit into
devfrom
navbar-env-aware-docs-links
May 21, 2026
Merged

Make navbar cross-product docs links environment-aware#73
tbantle22 merged 1 commit into
devfrom
navbar-env-aware-docs-links

Conversation

@tbantle22
Copy link
Copy Markdown
Collaborator

The Documentation dropdown in the navbar (and the mobile docs links) jump between the Dolt / DoltLab / Doltgres docs sites. They handled prod and localhost, but not the awsdev dev deployment — so on dolthub.awsdev.ld-corp.com the dropdown sent you to the prod doltlab.com / doltgres.com docs instead of the dev ones.

Change

Added a devDocsLinks set for the *.awsdev.ld-corp.com hosts and replaced the localhost-only check with a single docsLinksForHost(hostname):

Current host Cross-product docs links
localhost / 127.0.0.1 http://localhost:4321|4322|4323/docs
*.awsdev.ld-corp.com https://{dolthub,doltlab,doltgres}.awsdev.ld-corp.com/docs
anything else https://{dolthub.com,doltlab.com,doltgres.com}/docs

Detection is at runtime (in the existing useEffect) because all three sites ship one static build that's deployed to prod, awsdev, and the local dev servers alike — the serving host is the only signal. SSR / first paint still defaults to prod, same as before.

Verification

astro build on dolt is clean; confirmed the bundled navbar JS contains all three *.awsdev.ld-corp.com hosts and the endsWith(".awsdev.ld-corp.com") check.

Out of scope

The Footer also has a single "Documentation" link hardcoded to dolthub.com/docs, but the rest of the footer's links go to www.dolthub.com (the marketing site, no per-env split), so I left the footer alone to match the "documentation nav" ask. Easy to extend the same helper there if you want it.

🤖 Generated with Claude Code

The Documentation dropdown (and the mobile docs links) point at the
other products' docs sites. They handled prod and localhost, but not
the awsdev dev deployment — on dolthub.awsdev.ld-corp.com the dropdown
sent you to the prod doltlab.com / doltgres.com docs.

Add a devDocsLinks set for the *.awsdev.ld-corp.com hosts and pick the
link set by hostname at runtime (localhost/127.0.0.1 -> local dev
servers; *.awsdev.ld-corp.com -> dev; otherwise prod). Runtime
detection is required because the same static build is deployed to all
three environments, so the host is the only signal available; SSR/first
paint still defaults to prod.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tbantle22 tbantle22 merged commit 537be7b into dev May 21, 2026
7 checks passed
@tbantle22 tbantle22 deleted the navbar-env-aware-docs-links branch May 21, 2026 21:14
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