X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/26a71f36c68773b18095911e99be7294cbd66f39..HEAD:/keyboard.plp diff --git a/keyboard.plp b/keyboard.plp index 4a49ebb..3a40a4d 100644 --- a/keyboard.plp +++ b/keyboard.plp @@ -1,7 +1,13 @@ <(common.inc.plp)><: -my $mode = lc($Request || 'altgr'); -my $include = "$mode.eng"; +$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 $@; @@ -20,11 +26,13 @@ my @keystyle = ( Html({ title => "\L$mode\E keyboard cheat sheet", version => $info->{version} || '0.1', + canonical => -e "$Request.plp" ? "/$Request" : undef, # historic shorthand description => $info->{description} // ["Keyboard cheat sheet for the default controls of $mode."], keywords => [@{ $info->{keywords} // [] }, qw' sheet cheat reference overview keyboard control commands shortkey '], + image => $info->{image}, stylesheet => [qw( light dark circus mono red )], data => ["$include.inc.pl"], raw => \@keystyle, @@ -35,12 +43,12 @@ Html({ '404 request not found', ); -say "

$mode cheat sheet

"; +say "

$mode keyboard

"; say "

$_

" for $info->{intro} // (); say "

", $info->{mode}->{''}, " (default)

" if $info->{mode} and %{ $info->{mode} } > 1; -use Shiar_Sheet::Keyboard 2.08; +use Shiar_Sheet::Keyboard 3.00; my $keys = Shiar_Sheet::Keyboard->new($info); $keys->map($get{map}) or undef $get{map}; $keys->print_rows($get{rows} || $info->{moderows}, $info->{rows});