Static site generator
Static site generators (SSGs) are software engines that use text input files (such as
Architecture
SSGs typically consist of a template written in HTML with a templating system, such as liquid (Jekyll) or Go template (Hugo). The same structure (typically a Git repository) includes content in a plain-text format such as Markdown or reStructuredText, or in a structural meta format such as JSON or XML. A single plain-text file may correspond to a single web page. Alternatively, a single structural metadata file may correspond to an entire website if a single-page application framework like AngularJS is used. The website variable settings are stored in a plaintext configuration file _config.yml
(YAML), _config.toml
(TOML) or _config.json
(JSON). Page files typically also start with a YAML, TOML, or JSON preamble to define variables such as title, permalink, or date. Files with names that begin with an underscore (_
) such as _index.md
(as opposed to index.md
) are considered templates or archetypes and are thus not rendered as pages themselves.
Examples
Several hundreds SSGs have been documented to exist, with the vast majority being written in languages that are already prominent on the web, such as Python, Go, JavaScript and TypeScript.[4]
System label/name | Language | Notes |
---|---|---|
Jekyll | Ruby | Uses Liquid templating language.[4] |
Hugo | Go | Uses Go templates and its main selling point is its high speed when compiling.[4] |
Next.js | JavaScript | Uses React templates.[4] |
Pelican | Python
|
Uses Jinja2 templates.[4] Compiles HTML from reStructuredText or Markdown. |
Astro | JavaScript | Uses the .astro syntax language by default (familiar to HTML or JSX). Supports multiple frameworks: Svelte, React, Preact, Vue, SolidJS, Lit, AlpineJS. Compiles HTML from Markdown or MDX.[4] |