git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bump versions of all pages with visible changes since v1.11
[sheet.git]
/
sc.plp
diff --git
a/sc.plp
b/sc.plp
index 19149cf9eab759e64087bf1f79aec3bf80644b42..87befbd5ec897ab90425e14c846163004d3ace2b 100644
(file)
--- a/
sc.plp
+++ b/
sc.plp
@@
-20,18
+20,25
@@
my %scvers = (
game => 'StarCraft II LotV',
major => 2,
},
game => 'StarCraft II LotV',
major => 2,
},
+ index => 'bw',
+ 1 => 'bw',
+ 2 => 'lotv',
);
);
-$Request ||= 'bw';
-$Request = 'lotv' if $Request eq '2';
-my %scver = %{ $scvers{$Request} // {} }
+my $requestver = $scvers{$Request ||= 'index'}
or Html(), Abort("Requested version <q>$Request</q> not available", '404 request not found');
or Html(), Abort("Requested version <q>$Request</q> not available", '404 request not found');
+if (ref $requestver ne 'HASH') {
+ $header{Location} = "/sc/$requestver";
+ Abort("Canonical URL for $Request is at $requestver", '302 subpage alias');
+}
+
+my %scver = %{$requestver};
my $datafile = "sc-units-$Request.inc.pl";
Html({
title => "$scver{title} unit cheat sheet",
my $datafile = "sc-units-$Request.inc.pl";
Html({
title => "$scver{title} unit cheat sheet",
- version => '1.
2
',
+ version => '1.
3
',
description => [
"Reference of $scver{game} unit properties,"
. " comparing various statistics of all the units in $scver{name}"
description => [
"Reference of $scver{game} unit properties,"
. " comparing various statistics of all the units in $scver{name}"