Document files

A document file is a special segment file that creates the mandatory parts of an HTML document. A document file has .html extension, and the default name is document.html. The name of the default document file can be set in the configuration. The document files belong to the /components. A site must have a default document file, that is achievable in two ways:

  1. There is a document file in the root of the components directory.
  2. There is a document file in each language directories of the components directory.

If there is a document file in the root directory and one with the same name in a language directory, then the language specific one is used. A document file differs from the segment files in one thing only:

The document file has a layout segment ({{ layout }}).

The document file used rendering a page can be overwritten in the metadata of the content. A simple document file can look like this:

<!DOCTYPE html>
<html>
<head lang="{{ #language }}">
  <meta charset="UTF-8" />
  <title>{{ #title }}</title>
  <meta name="description" content="{{ #description }}" />
  <meta name="keywords" content="{{ #keywords }}" />
  <link rel="stylesheet" href="..." />
</head>
<body>

{{ layout }}

<script src="...>

</body>
</html>

The example shows some controls ({{ #<control-name> }}), too.