keyboard/altgr: cover images of all available subpages
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 28 Dec 2023 02:48:23 +0000 (03:48 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 28 Dec 2023 07:19:58 +0000 (08:19 +0100)
keyboard.plp
keyboard/altgr/index.inc.plp [new file with mode: 0644]
tools/mksitemap

index a2c2f2e95e3afcbd51abc87c96425e5a7ecf46d4..4b4592775ffee14d4c182dd4b36951746cc39f9a 100644 (file)
@@ -4,6 +4,11 @@ $Request ||= 'altgr/windows';
 my $mode = lc $Request;
 my $include = "keyboard/$mode.eng";
 
+if (-e (my $page = "keyboard/$Request/index.inc.plp")) {
+       Include $page;
+       exit;
+}
+
 my $info = eval { Data($include) } || {};
 warn "error in $include: ", @{$@} if ref $@;
 $mode = $info->{title} // $mode;
diff --git a/keyboard/altgr/index.inc.plp b/keyboard/altgr/index.inc.plp
new file mode 100644 (file)
index 0000000..36b50c3
--- /dev/null
@@ -0,0 +1,49 @@
+<: # included from keyboard.plp
+use 5.014;
+use warnings;
+
+my @incs = glob 'keyboard/altgr/*.eng.inc.pl';
+
+Html({
+       title => "altgr keyboard cheat sheets",
+       version => '1.0',
+       description => [
+               "Overview of alternate keyboard modes,",
+               "offering extended Unicode characters if a modifier key",
+               "(such as AltGr or option) is pressed.",
+       ],
+       keywords => [qw'
+               sheet cheat reference overview keyboard altgr option
+       '],
+       stylesheet => [qw( light dark circus mono red )],
+       data => ['keyboard/altgr/index.inc.plp', @incs],
+       raw => <<'.',
+<style>
+img {
+       object-fit: cover;
+       height: 100%;
+}
+</style>
+.
+});
+
+:>
+<h1>Extended keyboards</h1>
+
+<p>Representative images of available layouts
+with AltGr or similar modifier keys.</p>
+
+<section class="gallery"><:
+for my $inc (@incs) {
+       $inc =~ s/\Q.inc.pl\E$//;
+       print '<figure>';
+       printf '<a href="/%s">', $inc =~ s/\.eng$//r;
+       if (my $table = eval { Data($inc) }) {
+               printf '<img src="/%s" />', $_ for $table->{image} || ();
+               $inc = $table->{title};
+       }
+       printf '<figcaption>%s</figcaption>', $inc;
+       say '</a></figure>';
+}
+:></section>
+
index 2fd6ee085b052707fa12109fa0516055cca423c0..46ce568ea1995f2449a11773134b9509d505f5e6 100755 (executable)
@@ -10,7 +10,7 @@ use Time::Piece;
 my @pages = (
        [qw( index )],
        [qw( vi digraphs charset browser writing sc/lotv termcol dieren )],
-       [qw( readline latin unicode countries emoji perl )],
+       [qw( readline latin unicode countries emoji perl keyboard/altgr )],
        [qw(
                vimperator mutt nethack mplayer/mpv font codec
                keyboard/altgr/windows keyboard/altgr/macos
@@ -18,6 +18,7 @@ my @pages = (
        )],
        [qw(
                apl less screen digits sc/bw sc/hots termcol/legacy mplayer
+               keyboard/altgr/macos-abc keyboard/altgr/msx keyboard/altgr/ukext
        )],
        [qw( chars/table/html sample source plan )],
 );