A static site generator (SSG) compiles content files, templates, and assets into static HTML, CSS, and JavaScript before deployment. Instead of rendering each page on every request, the build step produces files that a CDN or web server can deliver directly.
How a static site generator works
Content (Markdown + front matter)
Templates and components
Assets and configuration
│
▼
SSG build
│
▼
public/ or dist/
│
▼
CDN / static host
A typical build does four things:
- Reads content: Parses Markdown and front matter metadata such as title, date, tags, and draft status.
- Applies templates: Maps content to layouts for pages, lists, taxonomies, and feeds.
- Generates output: Writes HTML pages, RSS feeds, sitemaps, and search indexes.
- Copies assets: Moves images, fonts, and static files into the output directory.
Benefits and trade-offs
| Benefit | Why it matters | Trade-off |
|---|---|---|
| Fast delivery | Prebuilt files can be served from edge caches | Build step required before changes go live |
| Smaller runtime surface | No per-request app runtime or database required for content pages | Dynamic features need APIs or client-side JavaScript |
| Portability | Content often lives as plain Markdown files | Template and plugin ecosystems vary by generator |
| Version control fit | Content and code can live in Git | Editorial workflows may need a CMS layer |
Static site generators work well for blogs, documentation, marketing sites, and portfolios. They are less suitable when every request needs personalized server-side rendering or real-time database queries.
Common static site generators
Popular SSGs include Astro, Hugo, Zola, Eleventy, Jekyll, and SvelteKit in static mode. For a comparison, see Best Static Site Generators in 2026.
Where a Git based CMS fits
An SSG handles rendering. A Git based CMS handles authoring by giving editors a browser interface that commits Markdown to the repository. That combination keeps the delivery architecture static while making content editing accessible to non-developers. See [What Is a Git based CMS?](/blog/Git based-cms-explained/).
Discussion
Loading discussion…