--- /dev/null
+package Newslash::Plugin::Canonical;
+use Mojo::Base 'Mojolicious::Plugin';
+use Mojo::URL;
+
+use POSIX qw(strftime locale_h);
+
+sub register {
+ my ($self, $app, $conf) = @_;
+
+ $app->hook(before_render => sub {
+ my ($c, $args) = @_;
+ return if $c->stash('canonical');
+ my $url = Mojo::URL->new($c->url_for);
+ $url->host('srad.jp');
+ $url->port('');
+ $url->scheme('https');
+ $c->stash(canonical => $url->to_string);
+ });
+ #$app->helper(canonical => sub { state $canonical = $self; });
+}
+
+
+
+1;
$app->plugin('Newslash::Plugin::ReCaptcha');
}
+ # set canocal (for test.srad.jp)
+ $app->plugin('Newslash::Plugin::Canonical');
+
# Event Que
$app->plugin('Newslash::Plugin::EventQue');