Templer::Site::Page - An interface to a site page.
use strict; use warnings; use Templer::Site::Page; my $page = Templer::Site::Page->new( file => "./input/foo.wgn" );
A page is any non-directory beneath the input-directory which matches the pattern specified by the user (defaults to "*.skx").
Pages are processed via the HTML::Template module to create the suitable output.
In templer the page objects are created by the Templer::Site module.
templer
This module is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or
b) the Perl "Artistic License".
Steve Kemp <steve@steve.org.uk>
Copyright (C) 2012-2015 Steve Kemp <steve@steve.org.uk>.
This library is free software. You can modify and or distribute it under the same terms as Perl itself.
The constructor.
The single appropriate argument is the hash-key "file", pointing to the page-file on-disk.
Read the file, and parse the header/content.
This is an internal method.
Return the body of the page.
Here we perform the textile/markdown expansion if possible via the use plugins loaded by Templer::Plugin::Factory.
Retrieve a field from the header of the page.
In the following example file "foo", "bar" and "title" are fields:
Foo: Testing .. Bar: file_glob( "*.gif" ) Title: This is my page title. ----- <p>This is my page content ..</p>
Return all known fields/values from the page.
Return the filename we were built from. This is the value passed in the constructor.
Return the layout-template to use for this page, if one has been set.
Return the dependencies of the current page.
Add a dependency to the current page. This is used so that the file-inclusion plugin can add such a thing.
To install App::Templer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Templer
CPAN shell
perl -MCPAN -e shell install App::Templer
For more information on module installation, please visit the detailed CPAN module installation guide.