Files
supabase/apps/docs/app/api
Pamela Chia 8eebfdf7c8 fix(docs): build crawler reference nav links from PROD_URL (#51956)
Bot-served SDK reference pages (`/api/crawlers`) built every nav link
from `request.url`. Behind the supabase.com/docs rewrite, that URL
carries the internal docs host, so agents following the nav landed there
instead of supabase.com. The canonical tag was already hardcoded to
supabase.com. I switched the nav links to `PROD_URL`, the constant the
markdown alternates and JSON-LD already use.

**Note:** I chose absolute `PROD_URL` links over root-relative
`/docs/...` hrefs because agents that convert the HTML to markdown or
plain text lose the page's base URL.

## To test

Tested on the PR preview:
- [x] `curl -s -A 'Claude-User (claude-code/2.1.303;
+https://support.anthropic.com/)'
<preview>/docs/reference/javascript/select | grep -o 'href="[^"]*"' |
sort -u | head`, expect every nav href to start with
`https://supabase.com/docs/reference/javascript/` and none to point at
the internal docs host
- [x] Same request with a browser UA, expect the regular reference page
(the browser route is untouched)

## Linear
- fixes GROWTH-1341
2026-10-19 22:30:55 +02:00
..
…