Repository navigation
Conversation
…ge#1001 to their new pages Add 17 entries to GONE_PAGES so the old Overview / Refresh Token / Error Codes pages (merged into /docs/api by longbridge#383), the market endpoints moved by longbridge#1001, and the /docs/content/news category redirect instead of 404. resolveGone() carries the locale prefix and .md twin, covering 51 page URLs plus their markdown twins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per review, /docs/error-codes now 301s to /docs/api?page=error-codes, the address used by in-site error code links. resolveGone() accepts a target with its own query: page requests get the target query first and the incoming query appended; .md requests drop the target query and go to the markdown twin (/docs/api.md, which already contains the error code table), so they never become ?page=error-codes.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed, looks good to merge. One suggestion before merging:
Checked locally by calling Will merge once this is updated. 拉罐的 Claude 代发 |
Summary
Two docs reorganisations left old URLs returning 404 with no redirect:
openapi.yamlx-pages, rendered at/docs/api).quote/pull/*andfundamental/{market,calendar}/*tomarket/*.Google Search Console (2026-10-20 ~ 11-17) still shows 6 of these URLs with 295 impressions (
/docs/how-to-access-apiavg. position 3.4,/docs/error-codes6.5). Developers following search results, AI tools or old links land on the 404 page.This PR adds 17 entries to the existing
GONE_PAGEStable infunctions/[[path]].ts(the #1317 mechanism).resolveGone()carries the locale prefix and the.mdtwin, so the 17 entries cover 51 page URLs (17 × en / zh-CN / zh-HK) plus their.mdtwins. One file. The only logic change is thatresolveGone()now accepts a target with its own query string (needed forerror-codes, see below); entries without a query behave exactly as before..md)/docs/how-to-access-api/docs/apix-pages.authenticationby #383/docs/refresh-token-api/docs/apix-pages.authenticationby #383/docs/error-codes/docs/api?page=error-codes(.md→/docs/api.md)x-pages.error-codesby #383; same address as in-site error code links (see below)/docs/quote/pull/trade-session/docs/market/trade-session/docs/quote/pull/trade-day/docs/market/trade-days/docs/quote/pull/market_temperature/docs/market/market-temperature/docs/quote/pull/history_market_temperature/docs/market/history-market-temperature/docs/fundamental/market/market-status/docs/market/market-status/docs/fundamental/market/unusual-items/docs/market/unusual-items/docs/fundamental/calendar/dividend-calendar/docs/market/calendar/dividend-calendar/docs/fundamental/calendar/earnings-calendar/docs/market/calendar/earnings-calendar/docs/fundamental/calendar/ipo-calendar/docs/market/calendar/ipo-calendar/docs/fundamental/calendar/macro-calendar/docs/market/calendar/macro-calendar/docs/fundamental/calendar/meeting-calendar/docs/market/calendar/meeting-calendar/docs/fundamental/calendar/merge-calendar/docs/market/calendar/merge-calendar/docs/fundamental/calendar/split-calendar/docs/market/calendar/split-calendar/docs/content/news/docs/content/news/newsnews/newsis in the sitemaperror-codesand targets with a query/docs/error-codesgoes to/docs/api?page=error-codes, the address in-site error code links use.resolveGone()now splits a target into path and query:/docs/error-codes/docs/api?page=error-codes/zh-HK/docs/error-codes?x=1/zh-HK/docs/api?page=error-codes&x=1(target query first, incoming query appended)/zh-CN/docs/error-codes.md/zh-CN/docs/api.md/en/docs/error-codes.md?x=1/docs/api.md?x=1For
.mdrequests the.mdsuffix goes on the path and the target query is dropped, so it never becomes?page=error-codes.md.?page=only switches the view in the browser; the markdown twin/docs/api.mdis the whole API Reference and already contains the error code table (checked in production:/docs/api.md,/zh-CN/docs/api.md,/zh-HK/docs/api.mdare 200 and include403201;/docs/api/error-codes(.md)is 404). The incoming query is kept in both cases, as before.Verification (before merge)
.md) return 200;/docs/api?page=error-codesis 200 in all 3 locales.onRequestlocally for each of the 17 paths × (root,/en,/zh-CN,/zh-HK) × (page,.md) × (no query,?a=1): 272/272 return 301 with the expectedLocation(/endropped, incoming query kept;error-codespages →?page=error-codes,error-codes.md→api.md). Existing entries and current pages unaffected (us_etf_filesandus_etf_files.md?q=2still 301 as before,/docs/market/trade-session,/docs/api,/docs/content/news/newspass through).vitest run: 60/60 passed.tsc --noEmit --strictandoxlinton the file: clean. (prettier -creports two pre-existing long lines onmain, not in this diff.)CLAUDE.md.Post-deploy check
Request each of the 17 old paths in en, zh-CN and zh-HK once (51 URLs):
301,Locationmatching the table (zh-CN / zh-HK keep their prefix, en has none)Locationtarget returns200error-codesalso in.mdfor all 3 locales: page →…/docs/api?page=error-codes,.md→…/docs/api.mdSample:
curl -sI https://open.longbridge.com/docs/how-to-access-api→301,location: https://open.longbridge.com/docs/api.🤖 Generated with Claude Code