App-PFT
view release on metacpan or search on metacpan
bin/pft-make view on Meta::CPAN
#
# PFT is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# PFT is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with PFT. If not, see <http://www.gnu.org/licenses/>.
=encoding utf8
=head1 NAME
pft make - Build the PFT website
=head1 SYNOPSIS
B<pft make>
=head1 DESCRIPTION
This command builds all content within the C<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 C<ROOT/build>
directory. During this process unresolved links are notified to the user
via standard error.
=head2 Templates and expansions
HTML templates must be stored in the C<ROOT/templates> directory.
The template engine in use is C<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 C<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 L<pft-init(1)>).
=head2 The output website
The output encoding depends on a configuration key in C<pft.yaml> (see
L<pft-init(1)>). The template is expected to define the encoding in a proper
way, that is by making use of the C<[% 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 C<a href> links
are relative, the generated site will work fine even if moved or copied
remotely on another system (see L<pft-pub(1)>).
=head2 Injected data
The B<pft make> command will populate the C<ROOT/build> directory.
Additional static data to inject in the resulting website can be placed in
the C<ROOT/inject> directory. This meets the common requirement of placing
additional files in the root directory of online websites (typical case
being the C<.htaccess> file of Apache).
The L<pft-make(1)> command will first attempt to hard-link the injected files,
from C<ROOT/inject> to C<ROOT/build>. If this fails (e.g. because
hard-links are not supported by the filesystem) soft-links are attempted.
If nothing else succeeds, B<pft make> will make a copy of each injected
file.
=head1 OPTIONS
=over
=item B<--help>
Show this guide.
=back
=head1 EXIT STATUS
=over
=item
1 in case of option parsing failure.
=item
2 if it was impossible to construct the filesystem tree.
=item
3 in case of corrupt configuration.
=back
=head1 SEE ALSO
L<pft(1)>, L<pft-gen-rss(1)>, L<pft-init(1)>
=cut
use strict;
use warnings;
use utf8;
use v5.16;
( run in 4.502 seconds using v1.01-cache-2.11-cpan-437f7b0c052 )