Statocles::Theme - Templates, headers, footers, and navigation
# Template directory layout /theme/site/layout.html.ep /theme/site/include/layout.html.ep /theme/blog/index.html.ep /theme/blog/post.html.ep my $theme = Statocles::Theme->new( store => '/theme' ); my $layout = $theme->template( qw( site include layout.html ) ); my $blog_index = $theme->template( blog => 'index.html' ); my $blog_post = $theme->template( 'blog/post.html' ); # Clear out cached templates and includes $theme->clear;
When the "store" is read, the templates inside are organized based on their name and their parent directory.
The root URL for this application. Defaults to
The source store for this theme.
If the path begins with ::, will pull one of the Statocles default themes from the Statocles share directory.
The cached template objects for this theme.
The cached template objects for the includes.
Handle the path :: share theme.
my $tmpl = $theme->read( $path )
Read the template for the given
path and create the template object.
my $tmpl = $theme->build_template( $path, $content )
Build a new Statocles::Template object with the given
my $tmpl = $theme->template( $path ) my $tmpl = $theme->template( @path_parts )
Get the template at the given
path, or with the given
my $tmpl = $theme->include( $path ); my $tmpl = $theme->include( @path_parts );
$theme->helper( $name, $sub );
Register a helper on this theme. Helpers are functions that are added to the template to allow for additional features. Helpers are usually added by Statocles plugins.
There are a default set of helpers available to all templates which cannot be overridden by this method.
Clear out the cached templates and includes. Used by the daemon when it detects a change to the theme files.
Templates, files that end in
.ep, will not be deployed with the rest of the site.