X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/2645cbf6f7364951ad8dc72649361844181c2b20..e162106cb6f2118c223c110ed2d69f3819458831:/sc.plp
diff --git a/sc.plp b/sc.plp
index 19149cf..01b4957 100644
--- a/sc.plp
+++ b/sc.plp
@@ -20,18 +20,25 @@ my %scvers = (
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 $Request
not available", '404 request not found');
-my $datafile = "sc-units-$Request.inc.pl";
+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";
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}"
@@ -47,13 +54,12 @@ Html({
],
stylesheet => [qw( light dark )],
raw => '',
- data => [$datafile],
+ data => ["$datafile.inc.pl"],
});
say "