Static site generators (SSGs) are software engines that use text input files (such as Markdown, reStructuredText, AsciiDoc, and JSON) to generate static web pages. Unlike dynamic websites, these static pages do not change based on the request. This reduces backend complexity and allows the site to be distributed efficiently via content delivery networks (CDNs). The simplified architecture also results in a much smaller attack surface, making it harder for attackers to modify the site.
Popular SSGs include Jekyll, Hugo, Eleventy, Gatsby, and Next.js.
SSGs are typically used for content that doesn’t change frequently, such as product pages, news articles, documentation, and blogs.
Architecture
SSGs usually consist of:
-
An HTML template combined with a templating system
(e.g., Liquid for Jekyll, Go templates for Hugo) -
Content stored as plain-text files
(Markdown, reStructuredText) -
Structured metadata formats
(JSON, YAML, XML) -
A configuration file such as
_config.yml,_config.toml, or_config.json
A single plain-text file typically corresponds to one generated page.
Alternatively, a single metadata file can represent an entire website when used with single-page app frameworks such as AngularJS.
Page files frequently begin with a YAML, TOML, or JSON frontmatter preamble that defines metadata such as:
-
title
-
permalink
-
date
Files beginning with an underscore (e.g., _index.md) are treated as templates or archetypes and are not rendered as standalone pages.
Examples
Hundreds of SSGs exist, most written in web-centric languages such as Python, Go, JavaScript, and TypeScript.
| System | Language | Notes |
|---|---|---|
| Jekyll | Ruby | Uses Liquid templating. |
| Hugo | Go | Uses Go templates; known for very fast compilation. |
| Next.js | JavaScript | Based on React templates. |
| Pelican | Python | Uses Jinja2 templates; compiles from reStructuredText or Markdown. |
| Astro | JavaScript | Uses .astro components; supports Svelte, React, Vue, etc.; compiles HTML from Markdown/MDX. |
| Docusaurus | JavaScript | Compiles from MDX, Markdown, and React components. |
| Eleventy | JavaScript | Supports 10+ template languages. |
Comparison with Server-Side Systems
Server-side template systems
Many server-side template systems can publish static output pages. This is common in content management systems such as Vignette. However, this is not considered “static site generation” in the same sense, because:
-
The dynamic template system still exists on the server
-
Publishing static output is an optional feature, not the core architecture
-
The process can be performed by external tools like
wget
Early forms of this concept relied on preprocessors and macro languages adapted for CGI environments. Later, extension-module technologies such as Server-Side Includes (SSI) offered more direct execution and templating.