index: release v1.18 with only altgr index linked
[sheet.git] / codec.plp
index 4251df9239cf9b95e16d585a21df325ecad57f51..f13b93ac198d545bbdcc5d12ab2a5eb35bc16867 100644 (file)
--- a/codec.plp
+++ b/codec.plp
@@ -4,27 +4,26 @@ my ($page, @feat) = split m{/+}, $Request || 'image';
 $page !~ /\W/ or Html(), Abort('Invalid codec type request', 400);
 @feat or @feat = 'default';
 my $title = "$page codecs";
+my $info = eval { Data("codec-$page") };
+if ($@) {
+       $info = {};
+}
 
 Html({
        title => "$title cheat sheet",
-       version => '1.0',
-       description => [
-       ],
-       keywords => [qw'
-               codec encoder encoding decode file format type mime
-               feature comparison support benchmark compression
-               image audio video
-       '],
+       version => '1.1',
+       description => $info->{intro},
+       keywords => [@{ $info->{keywords} // [] }, qw' feature comparison support benchmark '],
        stylesheet => [qw'light circus dark red'],
-       data => [qw'codec.inc.pl'],
+       data => ["codec-$page.inc.pl"],
        raw => '<style>td,th {width:8%} tbody th {white-space:nowrap}</style>',
 });
 
-my $info = do "codec-$page.inc.pl";
-$info and %{$info} > 1
-       or Abort("Requested codec type <q>$page</q> not available", '404 request not found', $@ // $!);
+%{$info}
+       or Abort("Requested codec type <q>$page</q> not available", '404 request not found');
 
 say "<h1>\u$title</h1>";
+say "<p>$_</p>" for $info->{intro} // ();
 
 my %BOOLSCORE = (y => [5, '✔'], n => [1, '✘'], 0 => [0, 'n/a']);
 :>