Static Rendering
   HOME

TheInfoList



OR:

Static site generators (SSGs) are software engines that use text input files (such as
Markdown Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as an easy-to-read markup language. Markdown is widely used for blogging and instant messaging, and also used ...
,
reStructuredText reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation. It is part of the Docutils project of the Python Doc-SIG (Documentation Special Inte ...
,
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 fo ...
and
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
) 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 a web browser exactly as stored, in contrast to dynamic web pages which are generated by a web application. Consequently, a static web page ...
s. Unlike dynamic websites, these static pages do not change based on the request. This simplifies the requirements for the backend and allows the site to be distributed via
content delivery network A content delivery network (CDN) or content distribution network is a geographically distributed network of proxy servers and their data centers. The goal is to provide high availability and performance ("speed") by distributing the service spat ...
s (CDN)s. The simple design also makes it harder for attackers to modify the website due to the smaller
attack surface The attack surface of a software environment is the sum of the different points (for " attack vectors") where an unauthorized user (the "attacker") can try to enter data to, extract data, control a device or critical software in an environment. Ke ...
of these relatively simple backends. 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'' (2007 film), a 2007 horror film Television * ''Jekyll'' (TV series), a 20 ...
, Hugo, Eleventy, Gatsby, and Next.js, SSGs are typically for rarely changing, informative content, such as product pages, news articles, software documentation, and blogs.


Architecture

SSGs typically consist of a template written in
HTML Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
with a templating system, such as Liquid (Jekyll) or Go template (Hugo). The same structure (typically a
Git Git () is a distributed version control system that tracks versions of files. It is often used to control source code by programmers who are developing software collaboratively. Design goals of Git include speed, data integrity, and suppor ...
repository) includes content in a plain-text format such as
Markdown Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as an easy-to-read markup language. Markdown is widely used for blogging and instant messaging, and also used ...
or
reStructuredText reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation. It is part of the Docutils project of the Python Doc-SIG (Documentation Special Inte ...
, or in a structural meta format such as
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
or
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
. 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 A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of loading entire new pages. The goal is fas ...
framework like
AngularJS AngularJS (also known as Angular 1) is a discontinued free and open-source JavaScript-based web framework for developing single-page applications. It was maintained mainly by Google and a community of individuals and corporations. It aimed to si ...
is used. The website variable settings are stored in a plaintext configuration file _config.yml (
YAML YAML ( ) 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 Extensible Marku ...
), _config.toml (
TOML Tom's Obvious, Minimal Language (TOML, originally ''Tom's Own Markup Language'') is a file format for configuration files. It is intended to be easy to read and write due to obvious semantics which aim to be "minimal", and it is designed to map u ...
) or _config.json (
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
). 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 hundred 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.


Comparison with server-side systems

Many ''server-side template systems'' have the 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 Vignette may refer to: * Vignette (entertainment), a sketch in a sketch comedy * Vignette (graphic design), decorative designs in books (originally in the form of leaves and vines) to separate sections or chapters * Vignette (literature), short, i ...
, 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''", a HTTP reque ...
. People began to use server-side dynamic pages generated from templates with pre-existing software adapted for this task. This early software was the
preprocessor In computer science, a preprocessor (or precompiler) is a Computer program, program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which i ...
s and macro languages, adapted for web use, running on CGI. Next, a simple but relevant technology was the direct execution made on extension modules, starting with SSI.


References

{{Reflist


External links


Enforcing Strict Model–View Separation in Template Engines
* Web design Static website generators