1 package App::SCS::Plugin::Core;
4 no warnings::illegalproto;
7 with 'App::SCS::Role::Plugin';
9 has templates => (is => 'lazy');
11 sub _build_templates {
13 return use_module('App::SCS::PageSet')->new(
14 base_dir => io->dir($self->app->config->{share_dir})->catdir('templates'),
18 has includes => (is => 'lazy');
22 return use_module('App::SCS::PageSet')->new(
23 base_dir => io->dir($self->app->config->{share_dir})->catdir('includes'),
29 PageList => 'App::SCS::Plugin::Core::PagePlugin::PageList',
31 class => 'App::SCS::Plugin::Core::PagePlugin::Template',
32 config => { templates => $self->templates },
35 class => 'App::SCS::Plugin::Core::PagePlugin::Include',
36 config => { includes => $self->includes },
38 PageData => 'App::SCS::Plugin::Core::PagePlugin::PageData',
41 sub default_page_plugins {
48 sub page_dispatchers {
51 $self->pages->get({ path => 'index' });
54 [ 302, [ 'Location' => "/$_[1]/" ], [] ]
57 $self->pages->get({ %_ })
61 ->get({ path => 'error_404' })
62 ->$_call_if_object(with_plugin_config => Status => 404);