Changeset 12557 for lang/perl/App-Chariot
- Timestamp:
- 05/27/08 21:45:18 (6 months ago)
- Location:
- lang/perl/App-Chariot/trunk/lib/App
- Files:
-
- 2 added
- 4 modified
-
Chariot.pm (modified) (1 diff)
-
Chariot/C/Index.pm (modified) (1 diff)
-
Chariot/C/Permalink.pm (modified) (1 diff)
-
Chariot/C/RSS.pm (modified) (2 diffs)
-
Chariot/Role (added)
-
Chariot/Role/C.pm (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/App-Chariot/trunk/lib/App/Chariot.pm
r12556 r12557 118 118 mkdir $self->config->output_dir; 119 119 for my $controller (@CONTROLLERS) { 120 $controller-> meta->get_method('create')->body->( $self);120 $controller->new->create($self); 121 121 } 122 122 } -
lang/perl/App-Chariot/trunk/lib/App/Chariot/C/Index.pm
r12556 r12557 1 1 package App::Chariot::C::Index; 2 2 use Moose; 3 with 'App::Chariot::Role::C'; 3 4 4 5 sub create { 5 my $self = shift;6 my ($self, $c) = @_; 6 7 7 print "create index page\n"; 8 my @list = reverse @{$self->dat->list}; 9 my $ifile = File::Spec->catfile($self->config->assets_dir, 'tmpl', 'index.tt'); 10 my $ofile = File::Spec->catfile($self->config->output_dir, 'index.html'); 8 my @list = reverse @{$c->dat->list}; 9 my $ifile = File::Spec->catfile($c->config->assets_dir, 'tmpl', 'index.tt'); 10 my $ofile = File::Spec->catfile($c->config->output_dir, 'index.html'); 11 11 12 $ self->render(12 $c->render( 13 13 $ifile => $ofile, { 14 entries => [ @list[0..($ self->config->index_stop)] ],14 entries => [ @list[0..($c->config->index_stop)] ], 15 15 } 16 16 ); -
lang/perl/App-Chariot/trunk/lib/App/Chariot/C/Permalink.pm
r12556 r12557 1 1 package App::Chariot::C::Permalink; 2 2 use Moose; 3 with 'App::Chariot::Role::C'; 3 4 4 5 sub create { 5 my ($self, ) = @_;6 my ($self, $c) = @_; 6 7 7 print "create permalink pages\n"; 8 my $ifile = File::Spec->catfile($self->config->assets_dir, 'tmpl', 'item.tt'); 9 for my $entry (@{$self->dat->list}) { 8 my $ifile = File::Spec->catfile($c->config->assets_dir, 'tmpl', 'item.tt'); 9 for my $entry (@{$c->dat->list}) { 10 10 my $cnt = 1; 11 11 for my $item (reverse @{$entry->items->list}) { 12 12 $item->count($cnt); 13 13 $item->entry( $entry ); 14 my $ofile = File::Spec->catfile($ self->config->output_dir, $item->permalink);15 $ self->render(14 my $ofile = File::Spec->catfile($c->config->output_dir, $item->permalink); 15 $c->render( 16 16 $ifile => $ofile, 17 17 { -
lang/perl/App-Chariot/trunk/lib/App/Chariot/C/RSS.pm
r12556 r12557 1 1 package App::Chariot::C::RSS; 2 2 use Moose; 3 with 'App::Chariot::Role::C'; 3 4 4 5 sub create { 5 my $self = shift;6 my ($self, $c) = @_; 6 7 7 print "create rss\n"; 8 9 my $ofname = File::Spec->catfile( $self->config->output_dir, $self->config->rss_filename ); 8 my $ofname = File::Spec->catfile( $c->config->output_dir, $c->config->rss_filename ); 10 9 11 10 my $rss = XML::RSS->new(version => '1.0'); 12 11 $rss->channel( 13 title => $ self->config->title,14 link => $ self->config->clog_url,15 description => $ self->config->changelog_description,12 title => $c->config->title, 13 link => $c->config->clog_url, 14 description => $c->config->changelog_description, 16 15 ); 17 16 18 my @list = reverse @{$ self->dat->list};19 for my $entry (@list[0..($ self->config->index_stop)]) {17 my @list = reverse @{$c->dat->list}; 18 for my $entry (@list[0..($c->config->index_stop)]) { 20 19 my $cnt = 1; 21 20 for my $item (reverse @{$entry->items->list}) { … … 25 24 $rss->add_item( 26 25 title => $item->title, 27 link => $ self->config->clog_url . $item->permalink,26 link => $c->config->clog_url . $item->permalink, 28 27 description => $item->content, 29 28 content => { 30 encoded => $ self->formatter->( $item->content ),29 encoded => $c->formatter->( $item->content ), 31 30 }, 32 31 );
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)