Adding sitemap to robots.txt.
This commit is contained in:
parent
aa00c1a699
commit
8692a4d9fa
@ -29,6 +29,7 @@ sub startup ($self) {
|
||||
# Normal route to controller
|
||||
$r->get('/')->to('Page#index');
|
||||
$r->get('/sitemap.xml')->to('Sitemap#sitemap');
|
||||
$r->get('/robots.txt')->to('Robots#robots');
|
||||
|
||||
# $r->get('/:post')->to('Page#post');
|
||||
$r->get('/stats')->to('Metrics#stats');
|
||||
|
14
lib/BurguillosInfo/Controller/Robots.pm
Normal file
14
lib/BurguillosInfo/Controller/Robots.pm
Normal file
@ -0,0 +1,14 @@
|
||||
package BurguillosInfo::Controller::Robots;
|
||||
use Mojo::Base 'Mojolicious::Controller', '-signatures';
|
||||
|
||||
sub robots($self) {
|
||||
my $robots_txt = <<"EOF";
|
||||
Sitemap: @{[$self->config('base_url')]}/sitemap.xml
|
||||
|
||||
User-Agent: *
|
||||
Disallow: /stats
|
||||
Disallow: /stats/*
|
||||
EOF
|
||||
$self->render(text => $robots_txt, format => 'txt');
|
||||
}
|
||||
1;
|
@ -1,3 +0,0 @@
|
||||
User-Agent: *
|
||||
Disallow: /stats
|
||||
Disallow: /stats/*
|
Loading…
Reference in New Issue
Block a user