NAME
pft make - Build the PFT website
SYNOPSIS
pft make
DESCRIPTION
This command builds all content within the ROOT/content
directory into HTML form.
The content will be first organized into an internal graph representation, so that each entry knows which other entries refer to it. Each node of the graph is then mapped on a HTML template, and and saved in the ROOT/build
directory. During this process unresolved links are notified to the user via standard error.
Templates and expansions
HTML templates must be stored in the ROOT/templates
directory.
The template engine in use is Template::Alloy
. In a nutshell, it allows to expand simple code blocks within a HTML (or text) skeleton, as for example in:
<title>[% site.title %]</title>
Loops and conditionals are also supported. See the Template::Alloy
user manual for learning the supported mini-language.
A bunch of pre-defined, templates are installed by default during the initialization process (see pft-init(1)).
The output website
The output encoding depends on a configuration key in pft.yaml
(see pft-init(1)). The template is expected to define the encoding in a proper way, that is by making use of the [% site.encoding %]
key in the HTML header:
<head>
<meta http-equiv="content-type"
content="text/html; charset=[% site.encoding %]">
...
</head>
The result of a build is a collection of HTML pages. Since a href
links are relative, the generated site will work fine even if moved or copied remotely on another system (see pft-pub(1)).
Injected data
The pft make command will populate the ROOT/build
directory.
Additional static data to inject in the resulting website can be placed in the ROOT/inject
directory. This meets the common requirement of placing additional files in the root directory of online websites (typical case being the .htaccess
file of Apache).
The pft-make(1) command will first attempt to hard-link the injected files, from ROOT/inject
to ROOT/build
. If this fails (e.g. because hard-links are not supported by the filesystem) soft-links are attempted. If nothing else succeeds, pft make will make a copy of each injected file.
OPTIONS
EXIT STATUS
1 in case of option parsing failure.
2 if it was impossible to construct the filesystem tree.
3 in case of corrupt configuration.