Project
commandbox-ssg
A static site generator implemented as a CommandBox module — Markdown and CFML templates, layouts, pagination, and a small build pipeline, all driven from the CLI. The predecessor to boxlang-ssg, its pure-BoxLang rewrite.
CLI-native
Four commands — ssg init, ssg build, ssg watch, ssg serve — installed as an ordinary CommandBox module via box install.
Tidy output
HTML output is run through jSoup to clean up markup before it's written, based on detected content type rather than a manual flag.
Build hooks
onBuildReady(), beforeProcessCollections(), and beforeGenerate() — optional lifecycle hooks in applicationHelper.cfm for custom build logic.
Live rebuild
ssg watch monitors .cfm, .md, .css, .js, and .json files and triggers a rebuild on change.
Installation & quick start
bashbox install commandbox-ssg
bashbox
mkdir my-test-site --cd
echo "### Hello from commandbox-ssg" > index.md
ssg build
Commands
| Command | What it does |
|---|---|
ssg init | Scaffolds the current (empty) directory with the commandbox-ssg-skeleton starter app. |
ssg build | Runs the full pipeline: loads ssg-config.json, includes, and global _data/, processes collections and pagination, then generates static output. Pass --showconfig to print the resolved process/config instead of building, or --verbose for extra build logging. |
ssg watch | Watches the current directory for .cfm/.md/.css/.js/.json changes (500ms debounce) and runs ssg build automatically. |
ssg serve | Writes a .htaccess and server.json for serving _site/ as clean-URL static content (if they don't already exist), then starts a CommandBox static web server. |
Build lifecycle hooks
Defining these functions in applicationHelper.cfm lets you run custom code at specific points in the build, and makes any functions you define there available when rendering pages:
| Hook | Fires |
|---|---|
onBuildReady() | Once configuration has been loaded. |
beforeProcessCollections() | Once template data has been loaded, before collections are processed. |
beforeGenerate() | After collections and pagination have been processed, before static files are written. |
.bxm templates, layouts, collections, pagination — running on the BoxLang CLI directly instead of as a CommandBox module.
Changelog highlights
Selected entries — see the repository for the complete history back to 0.0.5.
| Version | Change |
|---|---|
0.2.2 | Removed the skip_beautify flag in favor of content-type detection — only HTML files are run through jSoup now. |
0.2.0 | Adopted jSoup to tidy generated output. |
0.1.3 | Excluded _site/ by default (was breaking passthrough folders containing markdown); fixed pagination parent-template leakage into output; render now uses the template cache so excludeFromCollections works correctly. |
0.1.1–0.1.2 | Added applicationHelper.cfm support and the three build lifecycle hooks above. |
0.1.0 | build command rewritten; publishDate renamed to date (defaults to the file's last-modified time); nested global _data/**.json; new --showconfig flag. |
0.0.6–0.0.16 | Windows compatibility fixes, ssg serve added, ssg watch added, automatic _includes/ exclusion. |