diff options
author | Yorhel <git@yorhel.nl> | 2019-10-16 10:36:59 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-10-16 10:37:03 +0200 |
commit | 3f9a77c094f744f3f781bb0648f6ac2dd09038f5 (patch) | |
tree | bcc6d84064b95f562d713c261243521431a0e1b3 /lib | |
parent | b7c525893bdd374d067e34d307bf0bc32df73f97 (diff) |
HTML: Make "noindex" the default
Adding 'index => 0' to all pages is error-prone, and the majority of the
pages aren't indexed. Requiring an 'index => 1' for pages that may be
indexed is less work and a safer solution.
(Doesn't affect the v2 codebase, which still requires an explicit
'noindex => 1')
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNWeb/Docs/Edit.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/Docs/Page.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/HTML.pm | 4 | ||||
-rw-r--r-- | lib/VNWeb/Misc/History.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/User/Edit.pm | 4 | ||||
-rw-r--r-- | lib/VNWeb/User/List.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/User/Login.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/User/Notifications.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/User/Page.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/User/PassReset.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/User/PassSet.pm | 2 | ||||
-rw-r--r-- | lib/VNWeb/User/Register.pm | 2 |
12 files changed, 14 insertions, 14 deletions
diff --git a/lib/VNWeb/Docs/Edit.pm b/lib/VNWeb/Docs/Edit.pm index ad3af9ec..9e90f717 100644 --- a/lib/VNWeb/Docs/Edit.pm +++ b/lib/VNWeb/Docs/Edit.pm @@ -27,7 +27,7 @@ TUWF::get qr{/$RE{drev}/edit} => sub { $d->{editsum} = $d->{chrev} == $d->{maxrev} ? '' : "Reverted to revision d$d->{id}.$d->{chrev}"; - framework_ title => "Edit $d->{title}", index => 0, type => 'd', dbobj => $d, tab => 'edit', + framework_ title => "Edit $d->{title}", type => 'd', dbobj => $d, tab => 'edit', sub { elm_ DocEdit => $FORM_OUT, $d; }; diff --git a/lib/VNWeb/Docs/Page.pm b/lib/VNWeb/Docs/Page.pm index 15d501a2..2225890a 100644 --- a/lib/VNWeb/Docs/Page.pm +++ b/lib/VNWeb/Docs/Page.pm @@ -50,7 +50,7 @@ TUWF::get qr{/$RE{drev}} => sub { my $html = $cache{$d->{chid}} || md2html $d->{content}; $cache{$d->{chid}} ||= $html if $d->{chrev} == $d->{maxrev}; - framework_ title => $d->{title}, type => 'd', dbobj => $d, hiddenmsg => 1, + framework_ title => $d->{title}, index => 1, type => 'd', dbobj => $d, hiddenmsg => 1, sub { _rev_ $d if tuwf->capture('rev'); div_ class => 'mainbox', sub { diff --git a/lib/VNWeb/HTML.pm b/lib/VNWeb/HTML.pm index 8e7ffa3c..8c5b17e5 100644 --- a/lib/VNWeb/HTML.pm +++ b/lib/VNWeb/HTML.pm @@ -140,7 +140,7 @@ sub _head_ { link_ rel => 'alternate', type => 'application/atom+xml', href => "/feeds/posts.atom", title => 'Recent Posts'; } meta_ name => 'csrf-token', content => auth->csrftoken; - meta_ name => 'robots', content => 'noindex' if defined $o->{index} && !$o->{index}; + meta_ name => 'robots', content => 'noindex' if !$o->{index}; # Opengraph metadata if($o->{og}) { @@ -369,7 +369,7 @@ sub _hidden_msg_ { # Options: # title => $title -# index => 1/0, default 1 +# index => 1/0, default 0 # feeds => 1/0 # search => $query # og => { opengraph metadata } diff --git a/lib/VNWeb/Misc/History.pm b/lib/VNWeb/Misc/History.pm index c96d07cc..07166328 100644 --- a/lib/VNWeb/Misc/History.pm +++ b/lib/VNWeb/Misc/History.pm @@ -190,7 +190,7 @@ TUWF::get qr{/(?:([upvrcsd])([1-9]\d*)/)?hist} => sub { $obj->{title} = user_displayname $obj if $type eq 'u'; my $title = $type ? "Edit history of $obj->{title}" : 'Recent changes'; - framework_ title => $title, index => 0, type => $type, dbobj => $obj, tab => 'hist', $type eq 'u' ? (pubskin => $obj) : (), + framework_ title => $title, type => $type, dbobj => $obj, tab => 'hist', $type eq 'u' ? (pubskin => $obj) : (), sub { my $filt; div_ class => 'mainbox', sub { diff --git a/lib/VNWeb/User/Edit.pm b/lib/VNWeb/User/Edit.pm index 936a65e2..80fbacdf 100644 --- a/lib/VNWeb/User/Edit.pm +++ b/lib/VNWeb/User/Edit.pm @@ -71,7 +71,7 @@ TUWF::get qr{/$RE{uid}/edit}, sub { } my $title = $u->{id} == auth->uid ? 'My Account' : "Edit $u->{username}"; - framework_ title => $title, index => 0, type => 'u', dbobj => $u, tab => 'edit', + framework_ title => $title, type => 'u', dbobj => $u, tab => 'edit', sub { elm_ 'User.Edit', $FORM, $u; }; @@ -153,7 +153,7 @@ json_api qr{/u/edit}, $FORM, sub { TUWF::get qr{/$RE{uid}/setmail/(?<token>[a-f0-9]{40})}, sub { my $success = auth->setmail_confirm(tuwf->capture('id'), tuwf->capture('token')); my $title = $success ? 'E-mail confirmed' : 'Error confirming email'; - framework_ title => $title, index => 0, sub { + framework_ title => $title, sub { div_ class => 'mainbox', sub { h1_ $title; div_ class => $success ? 'notice' : 'warning', sub { diff --git a/lib/VNWeb/User/List.pm b/lib/VNWeb/User/List.pm index dc34fe38..cb106a7c 100644 --- a/lib/VNWeb/User/List.pm +++ b/lib/VNWeb/User/List.pm @@ -78,7 +78,7 @@ TUWF::get qr{/u/(?<char>[0a-z]|all)}, sub { ); my $count = @where ? tuwf->dbVali('SELECT count(*) FROM users WHERE', sql_and @where) : tuwf->{stats}{users}; - framework_ title => 'Browse users', index => 0, sub { + framework_ title => 'Browse users', sub { div_ class => 'mainbox', sub { h1_ 'Browse users'; form_ action => '/u/all', method => 'get', sub { diff --git a/lib/VNWeb/User/Login.pm b/lib/VNWeb/User/Login.pm index 160e6d99..7c93e058 100644 --- a/lib/VNWeb/User/Login.pm +++ b/lib/VNWeb/User/Login.pm @@ -9,7 +9,7 @@ TUWF::get '/u/login' => sub { my $ref = tuwf->reqGet('ref'); $ref = '/' if !$ref || $ref !~ /^\//; - framework_ title => 'Login', index => 0, sub { + framework_ title => 'Login', sub { elm_ 'User.Login' => tuwf->compile({}), $ref; }; }; diff --git a/lib/VNWeb/User/Notifications.pm b/lib/VNWeb/User/Notifications.pm index bb9328a2..b9327c93 100644 --- a/lib/VNWeb/User/Notifications.pm +++ b/lib/VNWeb/User/Notifications.pm @@ -111,7 +111,7 @@ TUWF::get qr{/$RE{uid}/notifies}, sub { 'ORDER BY n.id', $opt->{r} ? 'DESC' : 'ASC' ); - framework_ title => 'My notifications', index => 0, + framework_ title => 'My notifications', sub { div_ class => 'mainbox', sub { h1_ 'My notifications'; diff --git a/lib/VNWeb/User/Page.pm b/lib/VNWeb/User/Page.pm index 8e13e74b..dbb4a086 100644 --- a/lib/VNWeb/User/Page.pm +++ b/lib/VNWeb/User/Page.pm @@ -143,7 +143,7 @@ TUWF::get qr{/$RE{uid}}, sub { }); my $title = user_displayname($u)."'s profile"; - framework_ title => $title, index => 0, type => 'u', pubskin => $u, dbobj => $u, + framework_ title => $title, type => 'u', pubskin => $u, dbobj => $u, sub { div_ class => 'mainbox userpage', sub { h1_ $title; diff --git a/lib/VNWeb/User/PassReset.pm b/lib/VNWeb/User/PassReset.pm index 0037fdff..0edd21e3 100644 --- a/lib/VNWeb/User/PassReset.pm +++ b/lib/VNWeb/User/PassReset.pm @@ -4,7 +4,7 @@ use VNWeb::Prelude; TUWF::get '/u/newpass' => sub { return tuwf->resRedirect('/', 'temp') if auth; - framework_ title => 'Password reset', index => 0, sub { + framework_ title => 'Password reset', sub { elm_ 'User.PassReset'; }; }; diff --git a/lib/VNWeb/User/PassSet.pm b/lib/VNWeb/User/PassSet.pm index ef124cb4..71929812 100644 --- a/lib/VNWeb/User/PassSet.pm +++ b/lib/VNWeb/User/PassSet.pm @@ -18,7 +18,7 @@ TUWF::get $reset_url, sub { return tuwf->resNotFound if !$name || !auth->isvalidtoken($id, $token); - framework_ title => 'Set password', index => 0, sub { + framework_ title => 'Set password', sub { elm_ 'User.PassSet', tuwf->compile({}), tuwf->reqPath; }; }; diff --git a/lib/VNWeb/User/Register.pm b/lib/VNWeb/User/Register.pm index 2f79a93d..5135531b 100644 --- a/lib/VNWeb/User/Register.pm +++ b/lib/VNWeb/User/Register.pm @@ -5,7 +5,7 @@ use VNWeb::Prelude; TUWF::get '/u/register', sub { return tuwf->resRedirect('/', 'temp') if auth; - framework_ title => 'Register', index => 0, sub { + framework_ title => 'Register', sub { elm_ 'User.Register'; }; }; |