routes.pm 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package Theme;
  2. use strict;
  3. use warnings;
  4. no warnings 'experimental';
  5. use feature qw{signatures};
  6. use File::Basename qw{basename};
  7. use lib 'lib';
  8. use Trog::Routes::HTML;
  9. our $default_title = 'Houston Perl Mongers';
  10. our $default_image = 'img/icon/houstonpm.png';
  11. our $display_name = 'Houston Perl Mongers';
  12. our $description = 'Houston Perl Mongers';
  13. our $default_tags = 'houston.pm, houston, perl, mongers, Net::Jabber::Bot, Device::USB::LibUSB';
  14. our $show_madeby = 1;
  15. our $twitter_account = 'houstonpm';
  16. our $fb_app_id = 'bogus';
  17. our %routes = (
  18. '/about.html' => {
  19. method => 'GET',
  20. callback => sub {Trog::Routes::HTML::redirect_permanent('/about') },
  21. },
  22. '/meetings.html' => {
  23. method => 'GET',
  24. callback => \&Trog::Routes::HTML::series,
  25. data => { id => 1609008204, in_series => 1 },
  26. },
  27. '/announce_meeting.html' => {
  28. method => 'GET',
  29. callback => \&Trog::Routes::HTML::series,
  30. data => { id => 1609008204, in_series => 1, limit => 1 },
  31. },
  32. '/sponsors.html' => {
  33. method => 'GET',
  34. callback => \&sponsors,
  35. },
  36. '/faqs.html' => {
  37. method => 'GET',
  38. callback => \&faq,
  39. },
  40. '/projects/index.html' => {
  41. method => 'GET',
  42. callback => \&Trog::Routes::HTML::series,
  43. data => { id => 1608661217, in_series => 1 },
  44. },
  45. '/talks/mostrecent.html' => {
  46. method => 'GET',
  47. callback => \&Trog::Routes::HTML::series,
  48. data => { id => 1608661368, in_series => 1, limit => 1 },
  49. },
  50. '/talks/index.html' => {
  51. method => 'GET',
  52. callback => \&Trog::Routes::HTML::series,
  53. data => { id => 1608661368, in_series => 1 },
  54. },
  55. '/styles/houston.css' => {
  56. method => 'GET',
  57. callback => sub {Trog::Routes::HTML::redirect_permanent('/themes/houston.pm/styles/houston.css') },
  58. },
  59. '/talks/(\d.*)' => {
  60. method => 'GET',
  61. callback => sub {
  62. my ($query) = @_;
  63. Trog::Routes::HTML::redirect_permanent("/assets/talks/$query->{fragment}")
  64. },
  65. captures => ['fragment'],
  66. },
  67. );
  68. my $processor = Text::Xslate->new(
  69. path => 'www/themes/houston.pm/templates',
  70. );
  71. sub sponsors ($args, $render_cb) {
  72. my $out = $processor->render('sponsors.tx');
  73. return Trog::Routes::HTML::index($args,$render_cb, $out);
  74. }
  75. sub faq ($args, $render_cb) {
  76. my $out = $processor->render('faq.tx');
  77. return Trog::Routes::HTML::index($args,$render_cb, $out);
  78. }
  79. 1;