summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-12-04 13:50:09 +0100
committerYorhel <git@yorhel.nl>2008-12-04 13:50:09 +0100
commit5e6159b7dc5fa7a130ddffe6857f0db6ff360e45 (patch)
tree8ab613a31cea7dc703180b23601d87c5207a25fd
parentca84685230565f273332ed43bddfe61c5e0464a4 (diff)
Added noindex tag on pages I don't want to see indexed
Including anything related to editing, item histories, etc. No need to have those pages in google, is there?
-rw-r--r--lib/VNDB/Handler/Discussions.pm4
-rw-r--r--lib/VNDB/Handler/Misc.pm4
-rw-r--r--lib/VNDB/Handler/Producers.pm4
-rw-r--r--lib/VNDB/Handler/Releases.pm4
-rw-r--r--lib/VNDB/Handler/Users.pm14
-rw-r--r--lib/VNDB/Handler/VNEdit.pm2
-rw-r--r--lib/VNDB/Handler/VNPage.pm2
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm3
8 files changed, 19 insertions, 18 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index a719087e..c7dd17d6 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -231,7 +231,7 @@ sub edit {
!$num ? 'Reply to '.$t->{title} :
'Edit post';
my $url = !$tid ? "/t/$tag/new" : !$num ? "/t$tid/reply" : "/t$tid.$num/edit";
- $self->htmlHeader(title => $title);
+ $self->htmlHeader(title => $title, noindex => 1);
$self->htmlForm({ frm => $frm, action => $url }, $title => [
[ static => label => 'Username', content => userstr($self->authInfo->{id}, $self->authInfo->{username}) ],
!$tid || $num == 1 ? (
@@ -284,7 +284,7 @@ sub tagbrowse {
order => $type eq 'an' ? 't.id DESC' : 'tpl.date DESC',
);
- $self->htmlHeader(title => $title);
+ $self->htmlHeader(title => $title, noindex => !@$list);
$self->htmlMainTabs($type, $obj, 'disc') if $iid;
div class => 'mainbox';
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index fb4bf2d1..b2c087d4 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -73,7 +73,7 @@ sub history {
edit => $f->{e},
);
- $self->htmlHeader(title => $title);
+ $self->htmlHeader(title => $title, noindex => 1);
$self->htmlMainTabs($type, $obj, 'hist') if $type;
# url generator
@@ -166,7 +166,7 @@ sub history {
sub nospam {
my $self = shift;
- $self->htmlHeader(title => 'Could not send form');
+ $self->htmlHeader(title => 'Could not send form', noindex => 1);
div class => 'mainbox';
h1 'Could not send form';
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 49a7b879..8de27f7d 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -26,7 +26,7 @@ sub page {
)->[0];
return 404 if !$p->{id};
- $self->htmlHeader(title => $p->{name});
+ $self->htmlHeader(title => $p->{name}, noindex => $rev);
$self->htmlMainTabs(p => $p);
return if $self->htmlHiddenMessage('p', $p);
@@ -128,7 +128,7 @@ sub edit {
$frm->{lang} = 'ja' if !$pid && !defined $frm->{lang};
$frm->{editsum} = sprintf 'Reverted to revision p%d.%d', $pid, $rev if $rev && !defined $frm->{editsum};
- $self->htmlHeader(title => $pid ? 'Edit '.$p->{name} : 'Add new producer');
+ $self->htmlHeader(title => $pid ? 'Edit '.$p->{name} : 'Add new producer', noindex => 1);
$self->htmlMainTabs('p', $p, 'edit') if $pid;
$self->htmlEditMessage('p', $p);
$self->htmlForm({ frm => $frm, action => $pid ? "/p$pid/edit" : '/p/new', editsum => 1 }, "General info" => [
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 55ce8400..d024d6bb 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -26,7 +26,7 @@ sub page {
)->[0];
return 404 if !$r->{id};
- $self->htmlHeader(title => $r->{title});
+ $self->htmlHeader(title => $r->{title}, noindex => $rev);
$self->htmlMainTabs('r', $r);
return if $self->htmlHiddenMessage('r', $r);
@@ -273,7 +273,7 @@ sub edit {
$frm->{language} = 'ja' if !$rid && !defined $frm->{lang};
$frm->{editsum} = sprintf 'Reverted to revision r%d.%d', $rid, $rev if $rev && !defined $frm->{editsum};
- $self->htmlHeader(js => 'forms', title => $rid ? 'Edit '.$r->{title} : 'Add release to '.$v->{title});
+ $self->htmlHeader(js => 'forms', title => $rid ? 'Edit '.$r->{title} : 'Add release to '.$v->{title}, noindex => 1);
$self->htmlMainTabs('r', $r, 'edit') if $rid;
$self->htmlMainTabs('v', $v, 'edit') if $vid;
$self->htmlEditMessage('r', $r);
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index b12198e6..ac0e7397 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -53,7 +53,7 @@ sub login {
$frm->{_err} = [ 'login_failed' ] if !$frm->{_err};
}
- $self->htmlHeader(title => 'Login');
+ $self->htmlHeader(title => 'Login', noindex => 1);
$self->htmlForm({ frm => $frm, action => '/u/login' }, Login => [
[ input => name => 'Username', short => 'usrname' ],
[ static => content => '<a href="/u/register">No account yet?</a>' ],
@@ -97,7 +97,7 @@ sub newpass {
}
}
- $self->htmlHeader(title => 'Forgot Password');
+ $self->htmlHeader(title => 'Forgot Password', noindex => 1);
div class => 'mainbox';
h1 'Forgot Password';
p "Forgot your password and can't login to VNDB anymore?\n"
@@ -114,7 +114,7 @@ sub newpass {
sub newpass_sent {
my $self = shift;
return $self->resRedirect('/') if $self->authInfo->{id};
- $self->htmlHeader(title => 'New Password');
+ $self->htmlHeader(title => 'New Password', noindex => 1);
div class => 'mainbox';
h1 'New Password';
div class => 'notice';
@@ -152,7 +152,7 @@ sub register {
}
}
- $self->htmlHeader(title => 'Create an Account');
+ $self->htmlHeader(title => 'Create an Account', noindex => 1);
div class => 'mainbox';
h1 'Create an Account';
h2 'Why should I register?';
@@ -232,7 +232,7 @@ sub edit {
# create the page
my $title = $self->authInfo->{id} != $uid ? "Edit $u->{username}'s Account" : 'My Account';
- $self->htmlHeader(title => $title);
+ $self->htmlHeader(title => $title, noindex => 1);
$self->htmlMainTabs('u', $u, 'edit');
if($self->reqParam('d')) {
div class => 'mainbox';
@@ -276,7 +276,7 @@ sub delete {
if(!$act) {
my $u = $self->dbUserGet(uid => $uid)->[0];
return 404 if !$u->{id};
- $self->htmlHeader(title => 'Delete user');
+ $self->htmlHeader(title => 'Delete user', noindex => 1);
$self->htmlMainTabs('u', $u, 'del');
div class => 'mainbox';
div class => 'warning';
@@ -296,7 +296,7 @@ sub delete {
}
# done
elsif($act eq '/d') {
- $self->htmlHeader(title => 'Delete user');
+ $self->htmlHeader(title => 'Delete user', noindex => 1);
div class => 'mainbox';
div class => 'notice';
p 'User deleted.';
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 53410909..cada9875 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -104,7 +104,7 @@ sub edit {
!exists $frm->{$_} && ($frm->{$_} = $b4{$_}) for (keys %b4);
$frm->{editsum} = sprintf 'Reverted to revision v%d.%d', $vid, $rev if $rev && !defined $frm->{editsum};
- $self->htmlHeader(js => 'forms', title => $vid ? "Edit $v->{title}" : 'Add a new visual novel');
+ $self->htmlHeader(js => 'forms', title => $vid ? "Edit $v->{title}" : 'Add a new visual novel', noindex => 1);
$self->htmlMainTabs('v', $v, 'edit') if $vid;
$self->htmlEditMessage('v', $v);
_form($self, $v, $frm);
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 88bd876c..3b27579d 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -44,7 +44,7 @@ sub page {
my $r = $self->dbReleaseGet(vid => $vid, what => 'producers platforms');
- $self->htmlHeader(title => $v->{title});
+ $self->htmlHeader(title => $v->{title}, noindex => $rev);
$self->htmlMainTabs('v', $v);
return if $self->htmlHiddenMessage('v', $v);
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm
index 94491e01..03ff3258 100644
--- a/lib/VNDB/Util/LayoutHTML.pm
+++ b/lib/VNDB/Util/LayoutHTML.pm
@@ -9,7 +9,7 @@ use Exporter 'import';
our @EXPORT = qw|htmlHeader htmlFooter|;
-sub htmlHeader { # %options->{ title, js, search }
+sub htmlHeader { # %options->{ title, js, noindex, search }
my($self, %o) = @_;
# heading
@@ -24,6 +24,7 @@ sub htmlHeader { # %options->{ title, js, search }
script type => 'text/javascript', src => $self->{url_static}.'/f/script.js';
# most browsers don't like a self-closing <script> tag...
end;
+ meta name => 'robots', content => 'noindex, follow', undef if $o{noindex};
end;
body;
div id => 'bgright', ' ';