Static site generators, new trend

The purpose of GSS is to add CMS dynamism to the loading speed of a static node.

Creating a page on demand, as the content management system does, has advantages, such as tailoring the page to the user, as well as discomfort, since access to the database to obtain various content items significantly slows down access. By the way, since the page presented to visitors is basically the same, it is unreasonable to build it every time you visit. The tight ends respond to that, but they don't always work very well. Another major drawback is security: hackers target popular CMS, and when they find a loophole, it allows them to immediately access millions of sites and install malware on them, which has already happened to Wordpress and Drupal users.

Static solution

The answer to these problems is to install the content locally or on the server as text files (markdown or other) and create static HTML pages that are safe and quick to load. This is the goal of the static site generator. This does not interfere with having dynamic content, it is implemented by JavaScript plugins, and you just need to choose from several templates to use themes, as under Wordpress.

For example, in the case of Jekyll, each post created with a text editor is placed in a text file in the _ posts directory. The template contains fields for each piece of content. The generator then integrates the content into a template and places the generated HTML page in the site _ directory, which is accessible to visitors via the Internet.

A template is a template used to build a page. A simple example:

<head>
   <title>{{ title }}</title> 
</head>
<body>
<div id="content">
{{ content }}
</div>
</body>

The template contains two variables - "title" and "content," which are replaced by the title and content of the edited text file. The webmaster does not need to execute the template, it is included in every generator theme. Otherwise, you can use a template language such as Liquid, Stylus, etc.

Static node generator functions

All generators have a common list of functions :

Metadata

Text format markdown, textile, or other format provides fields for permanent data such as title, author name, date, category, path name, etc. These fields will be formatted in the CSS and presented according to the layout provided by the templates.

Symbolic links

This is something that works more or less well depending on the HMRC. This, for example, replaces the included file in the template file with a version such as script-1.2.3.js with a unique name: script-js .

Static assets (static assets)

These are items that are not processed by the generator, such as images, JS files, or CSS. These files are placed in a dedicated directory and the generator writes them to the online directory .

Other features are supported only by some GSS:

Got feedback

This is done using a plugin and database, but you can also add them to pages or use an external service like Disqus.

Page template

The ability to select a topic not for the entire site, but for each page. Templates can consist of a simple HTML page or be executed using a template language, for example, Jade, Haml, Musache, eRuby...

Gith

Git is a collaborative project update system developed for Linux. It can also be used for a regular website and allows you to have a remote image that is an exact copy of local content. Perhaps it allows many to work, but this is only one option. Not all generators offer Git, which is good if we have already used GitHub.

Additional database

With GSS, tickets are stored in text files rather than databases. This does not prevent the use of data from the database stored on the server, such as a list of saved users, comments.

Relative articles

Below WordPress is a list of articles related to the page displayed by the plugin. The same goes for generators, the plugin list mainly includes "linked posts."

Sitemap и RSS

The generator can also automatically update the sitemap and RSS file when a new page is added or when the page changes. Under Wordpress, the sitemap produces a plugin.

Search box

To add a search field, you must include a script or plugin on the pages. The result will be accelerated if the generator produces an index file of unusual words. You can also add a search field provided by an external site (such as Google) that indexes pages.

Main GSS

They all use the markdown format and textiles to edit text, among other things. All of them are free, open source and under a free license. There is no need to program for their use, the language is useful only if you want to contribute to the code.

Name/Site Language Template
Description
Jekyll
jekyllrb.com/
Ruby Liquid
Enables the development server to test the created pages.
It can be used to host a site on GitHub, except for plugins.
Requires a YAML description of the metadata in each page and the corresponding code in the template.
Liquid is a mandatory template system, and it is not easy to use.
Pelican
getpelican.com/
Python Jinja2
Ability to import tickets with Wordpress or Dotclear .
Editing in Markdown or reStructuredText.
Multi-language support.
Integration with Twitter is possible.
Wintersmith
wintersmith.io/
CoffeeScript Nephrite
Uses Node.js and gulp.js for plugin processing chains and building a site from static pages.
Preview is available locally.
Flexibility allows you to directly accept the content of a static site or other generator.
Hexo
github.com/hexojs/hexo
JavaScript + Git EJS, Swig, Stylus
A blog framework that uses Node.js to create pages.
Laid out on GitHub, Heroku, personal hosting with Git, in one order.
Imports Wordpress, Jumla, Jekyll pages.
Supports most Jekyll plugins.
Hugo
gohugo.io/
Guo Go templates, Amber, Ace
Converts catalog content to HTML pages.
Local server to preview.
The generation is very fast and designed for all types of sites .
Collect
assemble.io/
JavaScript Gandlebars
Works with Grunt.js (task performer) and Yeoman (ecosystem for page generators).
The peculiarity is to create elements that can be collected together to form web pages.
The page is created in an HTML template, JSON, YAML, or Gruntfile .
Kharp
harpjs.com/
CoffeeScript EJS, Jade, Stylus
Full platform with static web server.
Creating HTML/CSS/JS pages is one option.
Pages can be edited locally or online.
It's especially easy to get a job.

This list is not limited, but I have tried to include a generator for each programming language. It would also be possible to include a Lecturer (Python ).

After all, do I need to use GSS or CMS? All CMS functions can be provided to a static site when it can communicate with the server, and dynamically edit the page, which does not create problems with Ajax or WebSocket (the second is quite recently implemented). Wordpress is easier to use than a generator, so non-computer bloggers will probably prefer to use this CMS.
But if safety or reactivity are important points for the site, then the generator is clearly the best solution .