Skip to content

feat(docs): seed Docusaurus site at /site, deploy to docs.fallout.build via Cloudflare Pages (#41)#181

Closed
ChrisonSimtian wants to merge 1 commit into
mainfrom
feature/41-docs-site-phase1
Closed

feat(docs): seed Docusaurus site at /site, deploy to docs.fallout.build via Cloudflare Pages (#41)#181
ChrisonSimtian wants to merge 1 commit into
mainfrom
feature/41-docs-site-phase1

Conversation

@ChrisonSimtian
Copy link
Copy Markdown
Owner

Summary

Phase 1 of the documentation site migration (#41). Stands up Docusaurus 3.10 in /site/, reading from the existing ../docs/ tree (single source of truth, no fork). Deploys to docs.fallout.build via Cloudflare Pages.

What's in this PR

Area Change
/site/ Docusaurus 3.10 scaffold (TypeScript). path: '../docs', routeBasePath: '/docs', url: 'https://docs.fallout.build'. Drops the placeholder blog.
/site/src/theme/MDXComponents.tsx Globally registers Tabs, TabItem, CodeBlock, Admonition — same pattern as NUKE's site, so docs don't need new imports.
/site/src/components/ Stubs for AsciinemaPlayer, DownloadButton, ControlKey, ToolConfirmation (referenced by existing docs). Functional, not polished.
.github/workflows/docs-deploy.yml Build /site + push to Cloudflare Pages via cloudflare/wrangler-action@v3. Triggers on push to main when site/** or docs/** change.
.gitignore Excludes site/node_modules, site/build, site/.docusaurus.
docs/ (8 files) HTML comments → MDX comments (<!-- -->{/* */}) and two {#anchor} IDs removed from introduction.md. Pure parser-compat changes; no rendered output changes.

Why Cloudflare Pages, not GitHub Pages

GitHub Pages allows one site per repo, and fallout.build (apex) already serves from gh-pages on this repo. Cloudflare Pages handles docs.fallout.build via a CNAME on the fallout.build DNS pointing to the Pages project. Apex stays untouched.

CD POC framing

The deploy step (wrangler pages deploy site/build) is the v13 CD reference shape — build artifact, authenticated push to an external system's API. Exactly what ADR-0001's tasks → REST pattern targets. Kept minimal so it lifts cleanly into a Fallout primitive later ([CloudflarePagesDeploy] attribute, CloudflarePagesTasks.DeployPages(...)).

Manual setup needed before the workflow can deploy

  1. Cloudflare Pages project named fallout-docs (one-time, Cloudflare dashboard).
  2. Repo secrets:
    • CLOUDFLARE_API_TOKEN (scope: Pages:Edit)
    • CLOUDFLARE_ACCOUNT_ID
  3. DNS on fallout.build: CNAME docs → fallout-docs.pages.dev.
  4. Custom domain on Cloudflare Pages project → add docs.fallout.build.

The workflow merges and runs immediately; first run will fail at the deploy step until 1+2 are done. That's fine — the site can be merged and the secrets added afterwards without rebasing.

What's deferred to follow-up PRs

  • Broken-link cleanup. onBrokenLinks: 'warn' (not 'throw') so CI passes. Many internal links use the source path (/docs/01-getting-started/01-installation) but Docusaurus serves the stripped path (/docs/getting-started/installation). Content-touch only.
  • Algolia DocSearch wiring (apply for OSS plan first).
  • Custom favicon / logo / OG image (placeholder retained).
  • Per-PR preview deploys (Cloudflare Pages supports it; needs wrangler-action invoked on pull_request with preview branch arg).
  • AsciinemaPlayer wired to actual asciinema-player (cast files need to live somewhere accessible first).

Test plan

  • cd site && npm install && npm run build succeeds locally (42 HTML files generated).
  • Build output includes index.html, 404.html, docs/*, sitemap.xml.
  • After Cloudflare project + secrets are set up, push to this branch and confirm wrangler pages deploy succeeds.
  • After merge, confirm production deploy lands at https://docs.fallout.build.

Refs

🤖 Generated with Claude Code

…ld via Cloudflare Pages

Phase 1 of the documentation site migration (#41). Stands up Docusaurus
3.10 in /site/, configured to read from the existing ../docs/ tree as
its content source — no fork of doc content, single source of truth.

## What's in this PR

- **/site** — Docusaurus scaffold (TypeScript template) wired to:
  - read content from `../docs/` (path: '../docs')
  - serve at `/docs/*` (routeBasePath: '/docs')
  - render the Fallout homepage at `/`
  - target `https://docs.fallout.build` (production url)
- **/site/src/theme/MDXComponents.tsx** — globally registers Tabs,
  TabItem, CodeBlock, and Admonition so existing docs don't need to add
  explicit imports. Mirrors the NUKE site's behaviour.
- **/site/src/components/** — stub implementations of components the
  existing docs reference: AsciinemaPlayer (placeholder), DownloadButton,
  ControlKey, ToolConfirmation. Functional enough to build; visual
  polish is follow-up work.
- **.github/workflows/docs-deploy.yml** — builds /site and deploys to
  Cloudflare Pages on push to main when site/** or docs/** change.
- **.gitignore** — excludes site/node_modules, site/build, site/.docusaurus.
- **docs/** — minimal touch-ups to make the source compile under
  MDX 3 strictly:
  - HTML comments `<!-- ... -->` → MDX comments `{/* ... */}` in 8 files.
  - Removed two `{#anchor}` explicit IDs in introduction.md (slugs
    auto-generate from headings).

## Architectural choices

- **Same repo, /site folder.** docs/ is source-of-truth, /site is the
  builder. One PR cycle for both content and chrome.
- **Cloudflare Pages for the docs subdomain.** GitHub Pages' single-
  site-per-repo limit means we can't also serve docs.fallout.build from
  this repo via GH Pages (fallout.build apex already lives there).
  Cloudflare Pages handles the subdomain via a CNAME on fallout.build
  DNS pointing to the Pages project.
- **CD POC.** The deploy step (wrangler pages deploy) is the v13 CD
  reference point. The shape — build artifact, authenticated push to
  external system's API — is exactly what ADR-0001's "tasks → REST"
  pattern will eventually wrap. Kept minimal so it lifts cleanly into
  a Fallout primitive later.

## What's not in this PR

- Custom favicon / logo (Docusaurus default placeholder retained).
- Algolia DocSearch wiring (apply for OSS plan, follow-up PR).
- Cleanup of the broken-link warnings (numbered-prefix paths like
  /docs/01-getting-started/01-installation vs Docusaurus's stripped
  /docs/getting-started/installation). onBrokenLinks: 'warn' means CI
  still passes; content cleanup tracked as follow-up.
- Per-PR preview deploys.

## Manual setup needed (before deploy works)

1. Create Cloudflare Pages project named `fallout-docs` (one-time, via
   Cloudflare dashboard).
2. Add repo secrets:
   - `CLOUDFLARE_API_TOKEN` (Pages:Edit scope)
   - `CLOUDFLARE_ACCOUNT_ID`
3. Add DNS record on fallout.build: CNAME `docs` → `fallout-docs.pages.dev`.
4. In Cloudflare Pages project → Custom domains, add `docs.fallout.build`.

## Refs

- #41 (P7 — Documentation site migration)
- ADR-0001 (CD primitives — the deploy step is the v13 reference shape)
@ChrisonSimtian
Copy link
Copy Markdown
Owner Author

Closing — wrong architecture.

I assumed Cloudflare Pages would host the docs subdomain. The maintainer clarified that Cloudflare is DNS-only (wildcard `*.fallout.build` → GitHub Pages), and the GH Pages slot on this repo is taken by the apex. So a sibling `docs.fallout.build` site can't share this repo's GH Pages.

Decision: docs site moves to a new `Falloutdocs` repo with its own GH Pages and `docs.fallout.build` as custom domain. Markdown source stays in this repo's `docs/` folder; Falloutdocs's deploy workflow checks out Fallout@main at build time.

What carries forward

  • The MDX-compat fixes to 8 docs/ files (HTML → MDX comments, 2 anchor removals in `introduction.md`) — opening as a separate small PR against this repo since the new Falloutdocs builds depend on them.
  • The /site/ scaffold + component stubs + global MDXComponents — moving to the Falloutdocs repo.
  • The docs-deploy workflow — being rewritten for the new repo (GH Pages target, not Cloudflare Pages).

Tracking under #41 still.

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