routes.pm 974 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package Theme;
  2. use strict;
  3. use warnings;
  4. no warnings 'experimental';
  5. use feature qw{signatures};
  6. use lib 'lib';
  7. use Trog::Routes::HTML;
  8. our $default_title = 'TEODESIAN.NET WHIPS THEM CHIPS ~';
  9. our %routes = (
  10. '/links' => {
  11. method => 'GET',
  12. callback => \&links,
  13. },
  14. '/' => {
  15. method => "GET",
  16. data => { tag => ['news'] },
  17. callback => \&Trog::Routes::HTML::posts
  18. },
  19. );
  20. my $processor = Text::Xslate->new(
  21. path => 'www/themes/teodesian.net/templates',
  22. );
  23. my %paths = (
  24. '/news' => 'Headline Nudes',
  25. '/' => 'Headline Nudes',
  26. );
  27. sub path_to_tile ($path) {
  28. return $paths{$path} ? $paths{$path} : $path;
  29. }
  30. sub links ($query, $render_cb) {
  31. my $content = $processor->render('links.tx', {
  32. title => "Approved Propaganda from the ministry of family values",
  33. theme_dir => 'themes/teodesian.net',
  34. });
  35. return Trog::Routes::HTML::index($query, $render_cb, $content);
  36. }
  37. 1;