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:

  1. Reads content: Parses Markdown and front matter metadata such as title, date, tags, and draft status.
  2. Applies templates: Maps content to layouts for pages, lists, taxonomies, and feeds.
  3. Generates output: Writes HTML pages, RSS feeds, sitemaps, and search indexes.
  4. Copies assets: Moves images, fonts, and static files into the output directory.

Benefits and trade-offs

BenefitWhy it mattersTrade-off
Fast deliveryPrebuilt files can be served from edge cachesBuild step required before changes go live
Smaller runtime surfaceNo per-request app runtime or database required for content pagesDynamic features need APIs or client-side JavaScript
PortabilityContent often lives as plain Markdown filesTemplate and plugin ecosystems vary by generator
Version control fitContent and code can live in GitEditorial 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/).