NAME

Statocles::App - Base role for Statocles applications

VERSION

version 0.051

SYNOPSIS

    package MyApp;
    use Statocles::Base 'Class';
    with 'Statocles::App';

    sub pages {
        return Statocles::Page::Content->new(
            path => '/index.html',
            content => 'Hello, World',
        );
    }

DESCRIPTION

A Statocles App creates a set of pages that can then be written to the filesystem (or served directly, if desired).

Pages can be created from documents stored in a store (see Statocles::Page::Document), files stored in a store (see Statocles::Page::File), lists of content (see Statocles::Page::List), or anything at all (see Statocles::Page::Content).

ATTRIBUTES

site

The site this app is part of.

data

A hash of arbitrary data available to theme templates. This is a good place to put extra structured data like social network links or make easy customizations to themes like header image URLs.

url_root

The URL root of this application. All pages from this app will be under this root. Use this to ensure two apps do not try to write the same path.

METHODS

pages()

Get the pages for this app. Must return a list of Statocles::Page objects, with the index page (the page intended to be the entry page) first.

url( $url )

Get a URL to a page in this application. Prepends the "url_root" if necessary. Strips "index.html" if possible.

link( %args )

Create a link to a page in this application. %args are attributes to be given to Statocles::Link constructor.

INCLUDED APPS

These applications are included with the core Statocles distribution.

Statocles::App::Blog
Statocles::App::Plain
Statocles::App::Static
Statocles::App::Perldoc

SEE ALSO

Statocles::Store
Statocle::Page

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.