NAME

Templer::Site::Page - An interface to a site page.

SYNOPSIS

use strict;
use warnings;

use Templer::Site::Page;

my $page = Templer::Site::Page->new( file => "./input/foo.wgn" );

DESCRIPTION

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.

LICENSE

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".

AUTHOR

Steve Kemp <steve@steve.org.uk>

COPYRIGHT AND LICENSE

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.

METHODS

new

The constructor.

The single appropriate argument is the hash-key "file", pointing to the page-file on-disk.

_parse_page

Read the file, and parse the header/content.

This is an internal method.

content

Return the body of the page.

Here we perform the textile/markdown expansion if possible via the use plugins loaded by Templer::Plugin::Factory.

field

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>

fields

Return all known fields/values from the page.

source

Return the filename we were built from. This is the value passed in the constructor.

layout

Return the layout-template to use for this page, if one has been set.

dependencies

Return the dependencies of the current page.

add_dependency

Add a dependency to the current page. This is used so that the file-inclusion plugin can add such a thing.