Skip to content

feat: publish markdown sources and a blob index under /docs-api - #188

Merged
m1ngsama merged 1 commit into
mainfrom
feat/raw-docs-mirror
Sep 26, 2026
Merged

m1ngsama merged 1 commit into
mainfrom
feat/raw-docs-mirror

Conversation

@m1ngsama

Copy link
Copy Markdown
Member

Decision: after merge, the site serves every document's markdown source (about 2 MB) and a 27 KB index at stable URLs that the Prompt CLI will read; the paths and index format must stay stable. Check once deployed: curl -sI https://docs.nbtca.space/docs-api/raw/about/join.md shows content-type: text/plain, and a missing raw path returns 404. (utils/docs-api.ts, public/_headers)

The Prompt CLI reads documents through the GitHub API and raw.githubusercontent.com, which often reset or time out from mainland China; docs.nbtca.space does not.

  • A VitePress buildEnd hook copies each built page's markdown source to /docs-api/raw/<path> and writes /docs-api/index.json in the shape of GitHub's recursive tree, with each file's git blob sha.
  • The shas match git hash-object for all 247 documents, so the CLI's sha-verified cache keeps working across both sources.
  • /docs-api/raw/* is served as text/plain so Cloudflare compresses it.
  • @nbtca/docs falls back to GitHub whenever this mirror is missing, stale or down (feat: try an optional mirror before GitHub for the tree and files docs#9).

@m1ngsama
m1ngsama requested a review from sheepkinn as a code owner September 26, 2026 14:42
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying documents with  Cloudflare Pages  Cloudflare Pages

Latest commit: e7c7c83
Status: ✅  Deploy successful!
Preview URL: https://9f3351fe.documents-dq4.pages.dev
Branch Preview URL: https://feat-raw-docs-mirror.documents-dq4.pages.dev

View logs

@m1ngsama
m1ngsama merged commit 7c3c842 into main Sep 26, 2026
5 checks passed
@m1ngsama
m1ngsama deleted the feat/raw-docs-mirror branch September 26, 2026 15:00
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