stx build
Compile your documentation into a fully static site you can host anywhere. The build runs on the Syntext backend — the same pipeline that powers stx deploy — but instead of publishing to Syntext hosting, the compiled files are returned to you.
Usage
stx build [options]
Requires authentication (stx login) and a connected project (stx connect), since compilation happens server-side.
Options
| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--dir |
-d |
string | . |
Documentation directory |
--output |
-o |
string | dist |
Output directory for the built site |
--token |
string | Auth token (for CI, overrides login) | ||
--json |
boolean | false |
Machine-readable JSON output |
Examples
Standard Build
stx build
Uploads your source files, builds on the server, and downloads the result to ./dist/.
Custom Output Directory
stx build --output ./public
CI Usage
stx build --token $SYNTEXT_TOKEN --json
Output Structure
dist/
├── index.html
├── getting-started.html # one .html per page
├── getting-started.md # Markdown export per page
├── guides/
│ ├── quickstart.html
│ └── quickstart.md
├── api-reference/
│ └── *.html
├── ask.html # full-page AI chat route
├── 404.html
├── _assets/
│ └── search-index.json # static search index
├── llms.txt
├── llms-full.txt
├── sitemap.xml
├── robots.txt
├── _headers
├── _redirects
└── (your public/ assets)
Pages are emitted as flat .html files (for example guides/quickstart.html serves /guides/quickstart). Configure your host to resolve extensionless URLs — for Nginx:
location / {
try_files $uri $uri/ $uri.html =404;
}
Build Output
stx build
✔ Build complete!
Build: a1b2c3d4
Output: dist/
Files: 212 (3801 KB)
Pages: 97
Duration: 24810ms
Serve it with any static host, e.g. npx serve dist
Search Index
Every build includes _assets/search-index.json — a static index of all page content — so self-hosted sites can run search without calling the Syntext API.
Client-side search works well for small-to-medium sites (under 500 pages). For larger sites, consider hosting your own Meilisearch instance.
Validation
Builds run the same checks as deploys. Broken internal links are reported as warnings in the build output, and compile errors fail the build. To validate without building:
stx check
Self-Hosting
The build output is fully static and can be deployed anywhere:
- Cloudflare Pages
- Netlify
- AWS S3 + CloudFront
- GitHub Pages
- Nginx / Apache
See the Self-Hosted deployment guide for host-specific instructions.
For managed hosting with custom domains, analytics, and instant cache invalidation, use stx deploy instead.