font: coverage data as cover array in primary hash
[sheet.git] / sc.plp
diff --git a/sc.plp b/sc.plp
index b3c27fc6c8705c02786aa3bba48350b380af8e5f..8d021b793a7eec2e2ffdcee31df65a3146077a65 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -29,16 +29,16 @@ my $requestver = $scvers{$Request ||= 'index'}
        or Html(), Abort("Requested version <q>$Request</q> not available", '404 request not found');
 
 if (ref $requestver ne 'HASH') {
-       $header{Location} = $requestver;
+       $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";
+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}"
@@ -54,13 +54,12 @@ Html({
        ],
        stylesheet => [qw( light dark )],
        raw => '<link rel="stylesheet" type="text/css" media="all" href="/sc.css?1.2">',
-       data => [$datafile],
+       data => ["$datafile.inc.pl"],
 });
 
 say "<h1>$scver{game} units</h1>\n";
 
-my $units = do $datafile;
-Abort("Cannot open unit data", 501, $_) for $@ || $! || ();
+my $units = Data($datafile);
 my $patch = shift @{$units}
        or Abort("Cannot open unit data: metadata not found", 501);