Skip to content
SiteShiftCo

Static site generator (SSG)

A program that builds a static website from source files (templates, content, data, configuration) at build time, producing a folder of HTML, CSS, and JavaScript ready to deploy.

Also known as: SSG, static generator

A static site generator (SSG) is a program that builds a complete static website from source files, templates, content (often Markdown), data files, and configuration, at build time. The output is a folder of HTML, CSS, JavaScript, and assets that can be deployed to any web host or CDN.

SSGs are central to the JAMstack approach and are used to build many marketing sites, blogs, documentation sites, and small-to-medium ecommerce sites.

How a static site generator works

A typical SSG build process:

  1. The SSG reads source files (templates, content, configuration, data)
  2. It applies templates to content, producing complete HTML pages
  3. It processes assets (compiles CSS from Sass, bundles JavaScript, optimizes images)
  4. It writes the output to a folder (commonly dist/, public/, or _site/)
  5. The output folder is uploaded to a host or pushed to a CDN

The build typically runs:

  • On a developer’s machine during development
  • Automatically on a CI/CD platform (Netlify, Vercel, Cloudflare Pages, GitHub Actions) when source changes are pushed
  • On a schedule, when triggered by a webhook from a headless CMS, or on demand

Common static site generators

SSGLanguageNotable strengths
HugoGoVery fast builds, large theme ecosystem
JekyllRubyOriginal SSG; powers GitHub Pages
Eleventy (11ty)JavaScriptFlexible, low-config
AstroJavaScript / TypeScriptComponent-based, partial hydration, multi-framework
Next.js (static export)JavaScript / ReactHybrid SSG + SSR; large ecosystem
Nuxt (generate)JavaScript / VueVue equivalent of Next.js
GatsbyJavaScript / ReactGraphQL data layer, plugin ecosystem
HexoJavaScriptPopular for blogs, especially in Asia
ZolaRustSingle binary, fast
MkDocsPythonDocumentation-focused
DocusaurusJavaScript / ReactDocumentation + blog
VitePressJavaScript / VueDocumentation, Vue ecosystem

What an SSG typically provides

  • Template engine for layouts and components
  • Content processing for Markdown, MDX, or other formats
  • Routing based on file structure or configuration
  • Asset pipeline for CSS, JavaScript, and images
  • Build optimization (minification, code splitting, image optimization)
  • Live reload during development
  • Plugin or integration system for extending functionality

Strengths

  • Performance. Pre-built HTML loads quickly; no per-request server work
  • Hosting cost. Static files can be hosted free or very inexpensively
  • Scalability. Static files served from a CDN scale to high traffic without infrastructure changes
  • Security. No database or server-side execution on the request path reduces attack surface
  • Version control. Source files in Git enable preview deployments, rollbacks, and code review

Limitations

  • Build times. Large sites can have slow builds (mitigated by incremental builds in some SSGs)
  • Dynamic content. Personalization, real-time data, and per-user content require additional architecture (APIs, edge functions)
  • Editor experience. Without a layered CMS, content editing requires Git or specialized tools
  • Initial setup. More involved than installing a hosted CMS

SSG vs traditional CMS

AspectStatic site generatorTraditional CMS
Content storageFiles in a repository (or fetched from CMS at build)Database
Page generationAt build timePer request
HostingStatic host or CDNApplication server + database
Content editingMarkdown, headless CMS, or Git-based editorBuilt-in admin interface
Setup complexityHigherLower
Performance ceilingHighVariable; caching helps

SSG vs SSR framework

The line is blurring. Many modern frameworks (Next.js, Nuxt, Astro, SvelteKit) support both static generation and server-side rendering, often per-route. The choice between them within a project depends on whether content needs to be fresh per request.

Common workflows

  • Blog or marketing site with Markdown content. Astro, Hugo, Eleventy, or Jekyll, with content in .md files
  • Site with content in a CMS. Astro or Next.js fetching from Sanity, Contentful, or WordPress (headless mode)
  • Documentation site. Docusaurus, VitePress, MkDocs
  • Multi-language site. Hugo or Astro, with locale-specific content directories

Common misconceptions

  • “Static site generators are only for blogs.” They are used for marketing sites, documentation, ecommerce, and many other site types.
  • “All SSGs require coding.” Most do require some configuration, but many sites can be built and updated with mostly Markdown editing.
  • “SSGs can’t have a CMS.” They can pair with headless CMS platforms or Git-based editors that provide a familiar editing experience.