* Generate a robots.txt.

This commit is contained in:
Eelco Dolstra 2009-03-31 13:48:03 +00:00
parent 7b7c3f2265
commit d6e996d01c

View file

@ -243,6 +243,28 @@ sub get_builds : Chained('/') PathPart('') CaptureArgs(0) {
} }
sub robots_txt : Path('robots.txt') {
my ($self, $c) = @_;
# Put actions that are expensive or not useful for indexing in
# robots.txt. Note: wildcards are not universally supported in
# robots.txt, but apparently Google supports them.
my @rules =
( "User-agent: *"
, "Disallow: /*/nix/closure/*"
, "Disallow: /*/channel/*/MANIFEST.bz2"
, "Disallow: /*/nar/*"
, "Disallow: /*.nixpkg"
, "Disallow: /build/*/buildtime-deps"
, "Disallow: /build/*/runtime-deps"
, "Disallow: /build/*/nixlog/*/tail"
);
$c->stash->{'plain'} = { data => join("\n", @rules) };
$c->forward('Hydra::View::Plain');
}
sub default :Path { sub default :Path {
my ($self, $c) = @_; my ($self, $c) = @_;
notFound($c, "Page not found."); notFound($c, "Page not found.");