Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Contents
- Install — one-liner, Homebrew, Cargo, apt, AUR, Scoop, winget
- Quick Start — scaffold a site in 30 seconds
- Overview — what SSG does
- Architecture — build pipeline diagram
- Features — v0.0.36 capability matrix
- The CLI — flags and usage
- Library Usage —
ssg::run(), plugins, schemas - Benchmarks — binary size, test suite, coverage
- Development — make targets, contributing
- What's Included — all 36 modules
- License
Install
Quick install (prebuilt binary)
macOS / Linux — one command:
|
Auto-detects your OS and architecture, downloads the correct binary from GitHub Releases, verifies the SHA256 checksum, and installs to ~/.local/bin.
Homebrew (macOS / Linux):
Cargo (any platform with Rust):
Debian / Ubuntu (apt):
# Download the .deb from the latest release, then:
Or build it yourself with packaging/deb/build.sh.
Arch Linux (AUR):
# Using an AUR helper (e.g. yay):
Or build manually with the PKGBUILD in packaging/arch/.
Windows (Scoop):
scoop bucket add ssg https://github.com/sebastienrousseau/static-site-generator
scoop install ssg
Windows (winget):
winget install sebastienrousseau.ssg
Windows (manual): download the .zip from the latest release, extract ssg.exe, and add it to your PATH.
Use as a library
[]
= "0.0.36"
Build from source
Requires Rust 1.88.0+ (pinned in rust-toolchain.toml).
Quick Start
# 1 — Install
# 2 — Scaffold a new site
# 3 — Build with custom content
# 4 — Validate content schemas (no build)
# 5 — Development server
Overview
SSG generates static websites from Markdown content, YAML frontmatter, and HTML templates. It compiles everything into production-ready HTML with built-in SEO metadata, accessibility compliance, and feed generation. The plugin system handles the rest.
- Zero-cost performance — Rust ownership model, Rayon-parallelised plugins
- Incremental builds — content fingerprinting via
.ssg-cache.json - File watching — automatic rebuild on content changes
- 22-plugin pipeline — SEO, a11y, i18n, search, images, JSON-LD, RSS, sitemaps
- WCAG 2.1 Level AA — accessibility compliance validated on every build
- Lighthouse 100 — SEO and accessibility scores on generated output
Architecture
graph TD
A[Content: Markdown + YAML] --> B{SSG CLI}
B --> V[Content Schema Validation]
V --> C[Incremental Cache]
C --> D[Compile: staticdatagen]
D --> E[Post-Processing Fixes]
E --> F[Plugin Pipeline: 22 plugins]
F --> G[Output: HTML + RSS + Sitemap + JSON-LD]
B --> H[File Watcher]
H -->|changed files| C
B -->|--serve| S[Dev Server + Live Reload]
Features
| Performance | Parallel file operations with Rayon par_iter, iterative traversal with depth bounds, incremental builds, --jobs N thread control |
| Content | Markdown with GFM extensions (tables, strikethrough, task lists), YAML/TOML/JSON frontmatter, typed content schemas with compile-time validation |
| SEO | Meta description, Open Graph (title, description, type, url, image, image:width/height, locale), Twitter Cards (summary_large_image for articles), canonical URLs, robots.txt, sitemaps with per-page lastmod |
| Structured Data | JSON-LD Article/WebPage with datePublished, dateModified, author (Person entity), image (ImageObject), inLanguage, BreadcrumbList |
| Syndication | RSS 2.0 with enclosures, categories, language, lastBuildDate, copyright. Google News sitemap with keywords |
| Accessibility | Automatic WCAG 2.1 AA validation on every build. Decorative image detection (role="presentation"). Heading hierarchy, link text, ARIA landmarks |
| i18n | Hreflang injection for multi-locale sites, x-default support, per-locale sitemaps with xhtml:link alternates, language switcher HTML helper |
| Images | Responsive <picture> with AVIF/WebP sources, srcset at 320/640/1024/1440, lazy loading, CLS prevention via width/height from source metadata |
| Templates | Tera engine with inheritance, loops, conditionals, custom filters. 7 bundled templates + 3 themes (minimal, docs, full) |
| Search | Client-side full-text search with modal UI, 28 locale translations, Ctrl+K / ⌘K shortcut |
| Plugins | Lifecycle hooks: before_compile, after_compile, on_serve. 22 built-in plugins |
| Deployment | One-command config for Netlify, Vercel, Cloudflare Pages, GitHub Pages. CSP + HSTS security headers |
| Security | #![forbid(unsafe_code)], path traversal prevention, symlink rejection, file size limits, CycloneDX SBOM, Sigstore attestation |
| CI | Automated multi-platform releases (Linux glibc/musl, macOS ARM64/Intel, Windows), pa11y accessibility audits, cargo audit/deny |
The CLI
Usage: ssg [OPTIONS]
Options:
-f, --config <FILE> Configuration file path
-n, --new <NAME> Create new project
-c, --content <DIR> Content directory
-o, --output <DIR> Output directory
-t, --template <DIR> Template directory
-s, --serve <DIR> Start development server
-w, --watch Watch for changes and rebuild
-j, --jobs <N> Rayon thread count (default: num_cpus)
--validate Validate content schemas and exit
--drafts Include draft pages in the build
--deploy <TARGET> Generate deployment config (netlify, vercel, cloudflare, github)
-q, --quiet Suppress non-error output
--verbose Show detailed build information
-h, --help Print help
-V, --version Print version
Environment variables
| Variable | Default | Purpose |
|---|---|---|
SSG_HOST |
127.0.0.1 |
Dev server bind address (use 0.0.0.0 for WSL2/Codespaces) |
SSG_PORT |
3000 |
Dev server port |
Library Usage
// The simplest path: delegate to ssg's own pipeline.
use ;
use Result;
use Path;
;
Create content/content.schema.toml:
[[]]
= "post"
[[]]
= "title"
= "string"
= true
[[]]
= "date"
= "date"
= true
[[]]
= "draft"
= "bool"
= "false"
Pages with schema = "post" in their frontmatter are validated at compile time. Run ssg --validate for schema-only checks.
use BuildCache;
use Path;
let cache_path = new;
let content_dir = new;
let mut cache = load.unwrap;
let changed = cache.changed_files.unwrap;
if changed.is_empty else
Benchmarks
| Metric | Value |
|---|---|
| Release binary | ~23 MB stripped with LTO |
| Unsafe code | 0 blocks — #![forbid(unsafe_code)] enforced |
| Test suite | 848 lib + 34 doc tests |
| Dependencies | 21 direct (down from 25 in v0.0.35) |
| Coverage | ~98 % line coverage |
| Plugin pipeline | 22 plugins, Rayon-parallelised |
| Build | cargo build: ~2 min cold, <10 s incremental |
| MSRV | Rust 1.88.0 |
Development
See CONTRIBUTING.md for signed commits and PR guidelines.
What's Included
| Module | Purpose |
|---|---|
| cmd | CLI argument parsing, SsgConfig, input validation |
| process | Directory creation and site processing |
| lib | Orchestrator: run() → pipeline → compile → serve |
| plugin | Plugin trait with lifecycle hooks |
| plugins | MinifyPlugin, ImageOptiPlugin, DeployPlugin |
| postprocess | SitemapFixPlugin, NewsSitemapFixPlugin, RssAggregatePlugin, ManifestFixPlugin, HtmlFixPlugin |
| seo | SeoPlugin, JsonLdPlugin, CanonicalPlugin, RobotsPlugin |
| content | ContentSchema, ContentValidationPlugin, --validate |
| i18n | I18nPlugin, hreflang injection, per-locale sitemaps |
| search | Full-text index, search UI, 28 locale translations |
| accessibility | WCAG checker, ARIA validation, decorative image detection |
image_plugin |
<picture> with AVIF/WebP, responsive srcset |
| ai | AI-readiness hooks, alt-text validation, llms.txt |
| deploy | Netlify, Vercel, Cloudflare Pages, GitHub Pages adapters |
| assets | Asset fingerprinting and SRI hash generation |
| highlight | Syntax highlighting for code blocks |
| shortcodes | youtube, gist, figure, admonition expansion |
markdown_ext |
GFM tables, strikethrough, task lists |
| livereload | WebSocket live-reload injection (dev only) |
| pagination | Pagination plugin for listing pages |
| taxonomy | Tag and category index generation |
| drafts | Draft content filtering |
| frontmatter | Frontmatter extraction and .meta.json sidecars |
tera_engine |
Tera templating engine integration |
tera_plugin |
Tera template rendering plugin |
| cache | Content fingerprinting for incremental builds |
| watch | Polling-based file watcher |
| schema | JSON Schema generator for configuration |
| scaffold | Project scaffolding (ssg --new) |
| stream | High-performance streaming file processor |
| walk | Shared bounded directory walkers |
#![forbid(unsafe_code)]across the entire codebase- Path traversal prevention with
..detection and symlink rejection - File size limits (10 MB per file) and directory depth bounds (128 levels)
cargo auditwith zero warningscargo deny— license, advisory, ban, and source checksCycloneDXSBOM generated as release artifact with Sigstore attestation- SPDX license headers on all source files
- Signed commits enforced via SSH ED25519
License
Dual-licensed under Apache 2.0 or MIT, at your option.
See CHANGELOG.md for release history.