Static site generators (SSGs) are engines that use text input files (such as
Markdown,
reStructuredText, and
AsciiDoc
AsciiDoc is a human-readable document format, semantically equivalent to DocBook XML, but using plain-text mark-up conventions. AsciiDoc documents can be created using any text editor and read “as-is”, or rendered to HTML or any other f ...
) to generate
static web page
A static web page (sometimes called a flat page or a stationary page) is a web page that is delivered to the user's web browser exactly as stored, in contrast to dynamic web pages which are generated by a web application.
Consequently, a stati ...
s. Static sites generated by static site generators do not require a
backend after site generation, making them first-class citizens on
content delivery network
A content delivery network, or content distribution network (CDN), is a geographically distributed network of proxy servers and their data centers. The goal is to provide high availability and performance by distributing the service spatially r ...
s (CDNs). Some of the most popular static site generators are
Jekyll Jekyll may refer to:
Entertainment Film
* ''The Two Faces of Dr. Jekyll'', a 1960 horror film
* ''Dr. Jekyll y el Hombre Lobo'', a 1972 Spanish horror film
* ''Jekyll'', a 2007 horror film
Television
* ''Jekyll'' (TV series), a 2007 BBC televisi ...
,
Hugo, and
Next.js (
JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
). SSGs are typically for rarely-changing, informative content, such as product pages, news websites, (software) documentation, manuals, and blogs.
History
Prior to static site generators paradigm becoming widespread,
Wikipedia
Wikipedia is a multilingual free online encyclopedia written and maintained by a community of volunteers, known as Wikipedians, through open collaboration and using a wiki-based editing system. Wikipedia is the largest and most-read ref ...
was an ''
avant la lettre'' SSG, using markdown to serve static encyclopedic articles.
The first modern static site generator was
Jekyll Jekyll may refer to:
Entertainment Film
* ''The Two Faces of Dr. Jekyll'', a 1960 horror film
* ''Dr. Jekyll y el Hombre Lobo'', a 1972 Spanish horror film
* ''Jekyll'', a 2007 horror film
Television
* ''Jekyll'' (TV series), a 2007 BBC televisi ...
released in 2008 by
Tom Preston-Werner, one of the co-founders of GitHub. It popularized a system which:
* takes flat-text markdown inputs for content
* stores the template and content in the same structure (like a git repository)
Architecture
SSGs typically consist of a template written in
HTML
The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScri ...
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. A single file often corresponds to a single web page. The website variable settings are stored in a flat-text configuration file
_config.yml
(
YAML
YAML ( and ) (''see '') is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Ext ...
),
_config.toml
(
TOML) or
_config.json
(
JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other s ...
). Page files typically also start with a YAML, TOML or JSON preamble to define variables such as title, permalink, date, etc. 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, and JavaScript.
Comparison with server-side systems
Many ''server-side template systems'' have an option to publish output pages on the server, where the published pages are
static. This is common on
content management system
A content management system (CMS) is computer software used to manage the creation and modification of digital content ( content management).''Managing Enterprise Content: A Unified Content Strategy''. Ann Rockley, Pamela Kostur, Steve Manning. New ...
s, like
Vignette, but is not considered out-server generation. In the majority of cases, this "publish option" doesn't interfere with the ''template system'', and it can be made by external software, as
Wget
GNU Wget (or just Wget, formerly Geturl, also written as its package name, wget) is a computer program that retrieves content from web servers. It is part of the GNU Project. Its name derives from "World Wide Web" and " ''get''." It supports do ...
.

People began to use
server-side dynamic pages generated from templates with pre-existent software adapted for this task. This early software was the
preprocessors and
macro languages, adapted for the web use, running on
CGI. Next, a simple but relevant technology was the direct execution made on extension modules, started with
SSI.
References
{{Reflist
External links
JavaScript template librariescomparison from 2009
Enforcing Strict Model–View Separation in Template Engines
Scripting languages
*
Web design
Static website generators