<(common.inc.plp)><:
our $lang = $get{lang} || 'en';
-our $wordlistbase = "data/wordlist.$lang";
+our $wordlistbase = "data/wordlist";
if ($Request and $Request =~ m{\A([^/]+)}) {
my $page = "word/$1.plp";
utf8::downgrade($page); # unicode filename breaks contents encoding
if (-e $page) {
+ $wordlistbase .= ".$lang";
Include $page;
exit;
}
}
-my $wordlist = "$wordlistbase.inc.pl";
-my $limit = $get{v} // (exists $get{v} ? 4 : 3);
+my $limit = $get{v} // (exists $get{v} ? 5 : 3);
Html({
title => 'words cheat sheet',
keywords => [qw'
language
'],
- data => [$wordlist],
- raw => (exists $get{q} && <<'EOT')
+ data => ["$wordlistbase.inc.pl"],
+ raw => exists $get{q} ? <<'EOT' : undef,
<style>
.gallery figure {
grid-row: span 1 !important;
font-size: 175% !important;
}
</style>
-EOT
- . <<'EOT',
-<style>
-body {
- margin: 8px 1px;
-}
-</style>
EOT
});
</p>
<:
-my $table = do $wordlist or die $@ // $!;
+my $table = Data($wordlistbase);
sub showimg {
my ($id, $name) = @_;
$name = "<q>$name</q>" if $name =~ s/\?$//;
$name = "<figcaption>$name</figcaption>";
- if ($id and -e (my $img = "data/word/en/$id.jpg")) {
+ if ($id and -e (my $img = "data/word/32/$id.jpg")) {
$name .= sprintf '<img src="/%s" alt="%s" />', $img, $imgname;
}
return sprintf '<figure%s>%s</figure>', $hidden && !exists $get{v} && ' hidden', $name;
$table = {};
printimgs(@rows);
}
+elsif ($Request and $Request =~ /^\d+$/) {
+ printimgs([$Request]);
+}
else {
- printimgs($Request || $table->{''}->[0]);
+ printimgs($table->{''}->[0]);
}
say '</section>';