Ugrás a fő tartalomhoz

deploying-docs


sidebar_position: 7 title: Deploying Docs (Cloudflare Pages)


Deploying the Documentation Site

The CakeMarket documentation (Docusaurus) is bundled into the main Next.js app and served under /docs on the same Cloudflare Worker. There is no separate deployment — docs are built as static files and copied into public/docs/ before the Next.js build.

How It Works

  1. npm run build:docs builds the Docusaurus site with baseUrl: /docs/
  2. The built output is copied from docs/build/ to public/docs/
  3. Next.js picks up public/docs/ as static assets
  4. The OpenNext/Cloudflare build bundles them into .open-next/assets
  5. The cakemarketdev worker serves everything — app and docs — from one deployment

Build Commands

CommandDescription
npm run build:docsBuild docs only (into public/docs/)
npm run buildBuild docs + Next.js app
npm run deployBuild docs + Next.js + deploy to Cloudflare
npm run previewBuild docs + Next.js + local preview

Local Development

To work on docs locally:

cd docs
npm install
npm start

This starts the Docusaurus dev server at http://localhost:3000/docs/.

Configuration

Key files:

docs/
├── docusaurus.config.ts # baseUrl: /docs/, url: cakemarket.app
├── sidebars.ts # Sidebar navigation structure
├── docs/ # Markdown content
│ ├── user-guides/ # Buyer, seller, admin guides
│ ├── tech/ # Technical documentation
│ └── legal/ # Legal documents, one folder per country
│ ├── poland/ # PL: ToS, privacy, cookies, seller agreement
│ └── hungary/ # HU: legal overview (full docs in preparation)
├── src/css/custom.css # Custom styles
├── static/ # Static assets (images, icons)
└── package.json # Dependencies

The public/docs/ directory is gitignored — it is generated at build time.

Updating the Docs

  1. Edit markdown files in docs/docs/
  2. Test locally: cd docs && npm start
  3. Commit and push — the next deploy will include the updated docs

Troubleshooting

Docusaurus is configured with onBrokenLinks: 'throw'. Fix any broken internal links before pushing. Run cd docs && npm run build locally to check.

Static assets not loading

Ensure static files are in docs/static/ and referenced with paths relative to the docs base URL (e.g., /docs/img/screenshot.png in production).