Codex: A Markdown Folder to a Live Docusaurus Docs Site
Drop a folder of markdown into a Docusaurus project and have Codex assemble the site, fix broken links, then deploy a Vercel preview.
Run this workflow
CI-verified, 4/4 fixtures passing.
Build this with your agent
One copy-paste hands Claude Code, Codex, or Cursor the full recipe, steps included, nothing to fetch.
Intended Use
Turning a folder of markdown into a Docusaurus site with a sidebar and search, then a shareable Vercel preview, via Codex's @build-web-apps and @vercel plugins. Docusaurus is ideal because its build is the test: with onBrokenLinks set to throw, a broken internal link fails the build. CI verifies that guard is enabled and the build is wired; the full docusaurus build and the @vercel deploy are fenced.
Not for
- Configs that swallow broken links, keep onBrokenLinks set to throw so the build stays a real test
- Production deploys by default, preview is the default; ask for production explicitly
- Anyone expecting CI to run the full docusaurus build or the deploy, those are fenced
The Stack
Tested Against
codex@latestdocusaurus@3.xnode@20.xSide effects & data flow
- Network
- none, local only
- Writes
- ./docs/, ./package.json, ./docusaurus.config.js, ./checkdocs.mjs
- Credentials
- none required
Prerequisites
- Codex with the @build-web-apps and @vercel plugins
- A Docusaurus project and a docs/ folder of markdown
- A Vercel login for the preview deploy
Steps
- 1
Ask Codex to assemble the docs and ship a preview
Use @build-web-apps to turn the markdown in docs/ into a Docusaurus site with a sensible sidebar and search. Fix any broken internal links. Run the local build, then use @vercel to deploy a preview and send me the URL.
- 2
What CI checks: broken links fail the build and the build is wired
Docusaurus's build is the test: with onBrokenLinks set to throw, a broken internal link fails the build, so a green build means a publishable site. CI confirms that guard is enabled in the config and the build is wired (docusaurus build, @docusaurus/core present, docs markdown present). The full docusaurus build that actually crawls the links is fenced.
mkdir -p docs cat > docs/intro.md <<'EOF' # Intro Welcome to the docs. EOF cat > package.json <<'EOF' { "name": "docs-site", "private": true, "scripts": { "build": "docusaurus build", "start": "docusaurus start" }, "dependencies": { "@docusaurus/core": "^3.6.0", "@docusaurus/preset-classic": "^3.6.0", "react": "^19.0.0", "react-dom": "^19.0.0" } } EOF cat > docusaurus.config.js <<'EOF' module.exports = { title: 'Docs', url: 'https://example.com', baseUrl: '/', onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'throw', presets: [['classic', { docs: { path: 'docs' } }]], }; EOF cat > checkdocs.mjs <<'EOF' import { readFileSync, existsSync } from 'node:fs'; let ok = true; function check(label, cond){ console.log(label + ': ' + (cond ? 'yes' : 'NO')); if(!cond) ok=false; } const pkg = JSON.parse(readFileSync('package.json', 'utf8')); check('build script is docusaurus build', String((pkg.scripts||{}).build||'').includes('docusaurus build')); check('docusaurus core is a dependency', !!(pkg.dependencies && pkg.dependencies['@docusaurus/core'])); const cfg = existsSync('docusaurus.config.js') ? readFileSync('docusaurus.config.js', 'utf8') : ''; check('build fails on broken links (onBrokenLinks: throw)', cfg.includes("onBrokenLinks: 'throw'")); check('docs folder has markdown', existsSync('docs/intro.md')); if(!ok){ console.log('docusaurus build-readiness check FAILED'); process.exit(1); } console.log('docusaurus build-readiness check OK'); EOF node checkdocs.mjs - 3
Let Codex build and deploy (the model + account step, not checked by CI)
Codex assembles the content, runs the full docusaurus build (which crawls and validates every internal link), and @vercel deploys the preview. The assembly and the deploy are non-deterministic and account-gated, so CI never runs them. The badge covers the broken-link guard and a wired build, not the live site.
Eval, 4 fixtures
Last passed: verified todaybroken-link-guardcontainstimeout 30s · max $0Expected:
build fails on broken links (onBrokenLinks: throw): yesbuild-wiredcontainstimeout 30s · max $0Expected:
build script is docusaurus build: yescheck-okcontainstimeout 30s · max $0Expected:
docusaurus build-readiness check OKclean-exitexit_codetimeout 30s · max $0Expected:
0
Results
Markdown nobody can find becomes a searchable, link-checked docs site with a shareable URL.
Did this work for you?
Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.
Related workflows
- One AGENTS.md, no drift: prove CLAUDE.md is a real symlink and the generated files are in sync
- Self-host CodeWiki on private code: validate the config before you spend tokens
- Run GLM-5.2 for the bulk, escalate the hard turns to Opus 4.8
- codebase-memory-mcp: wire the knowledge graph, stop re-reading files
- OrcaRouter for coding: judge by passing tests, not by vibes
- Kilo Code: add an MCP tool and bind it to one mode
Liked this workflow?
Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).