| 1 | package Gitalist::Controller::OPML; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | use Moose::Autobox; | ||
| 5 | use DateTime; | ||
| 6 | use Sys::Hostname qw/hostname/; | ||
| 7 | |||
| 8 | use namespace::autoclean; | ||
| 9 | |||
| 10 | BEGIN { extends 'Gitalist::Controller' } | ||
| 11 | |||
| 12 | sub opml : Chained('/base') Args(0) { | ||
| 13 | my ($self, $c) = @_; | ||
| 14 | |||
| 15 | $c->stash( | ||
| 16 | title => lc(hostname()) . ' - ' . blessed($c)->config->{name}, | ||
| 17 | Repositories => $c->model()->repositories, | ||
| 18 | now => DateTime->now, | ||
| 19 | template => 'opml.tt2', | ||
| 20 | no_wrapper => 1, | ||
| 21 | ); | ||
| 22 | |||
| 23 | $c->response->content_type('application/rss'); | ||
| 24 | } | ||
| 25 | |||
| 26 | __PACKAGE__->meta->make_immutable; |