# build
Build your site into static HTML files.
# Usage
bok build [config]
# Arguments
| Argument | Description | Default |
|---|---|---|
config |
Path to config file | config.ts |
# What It Does
- Cleans the output directory
- Discovers pages based on your file discovery mode (walk, glob, or toc)
- Processes each page:
- Extracts front matter
- Converts Markdown to HTML
- Generates right-side table of contents
- Applies the layout template
- Copies assets (theme assets + public directories)
- Outputs a summary table
# Output
After building, you'll see a summary:
[INFO] Building
┌─────────┬────┐
│ │ EN │
├─────────┼────┤
│ # Pages │ 12 │
└─────────┴────┘
# Output Directory
By default, files are output to site/ relative to your config file. Configure this with paths.output:
export default {
paths: {
output: "dist", // Output to dist/ instead
},
};
# URL Structure
# Pretty URLs (default)
content/getting-started.md → site/getting-started/index.html
content/guide/intro.md → site/guide/intro/index.html
content/index.md → site/index.html
# Ugly URLs
Set uglyURLs: true in your config:
content/getting-started.md → site/getting-started.html
content/guide/intro.md → site/guide/intro.html
# Examples
# Build with default config
bok build
# Build with explicit config
bok build ./docs/config.ts
# Build and then deploy
bok build config.ts && rsync -av site/ server:/var/www/