X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/84cb696906fed0069c2a22256c15adf0abf4f4e7..8c62b3e7c9fdfd366c348fca3203811244f8e203:/keyboard.plp diff --git a/keyboard.plp b/keyboard.plp index 62e150a..4b45927 100644 --- a/keyboard.plp +++ b/keyboard.plp @@ -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; @@ -26,6 +31,7 @@ if ($Request =~ /^altgr/ and open my $cssinc, '<', 'keyboard/altgr.css') { 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' @@ -42,7 +48,7 @@ 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;