git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyboard/altgr: order index by subpage categories
[sheet.git]
/
common.inc.plp
diff --git
a/common.inc.plp
b/common.inc.plp
index 2976cbe37cd07615b1f9073d9fc332b403e19e24..0754d85acf7c8f8bfafd56f245691e0085678ed0 100644
(file)
--- a/
common.inc.plp
+++ b/
common.inc.plp
@@
-106,7
+106,7
@@
sub Data {
local $/; # slurp
return JSON::decode_json(readline $cache);
};
local $/; # slurp
return JSON::decode_json(readline $cache);
};
- if ($
! or $
@ or !@data or !$data[0]) {
+ if ($@ or !@data or !$data[0]) {
die ['Table data not found', $@ || $!];
}
if (@data == 1 and ref $data[0] eq 'HASH' and not %{$data[0]}) {
die ['Table data not found', $@ || $!];
}
if (@data == 1 and ref $data[0] eq 'HASH' and not %{$data[0]}) {
@@
-147,8
+147,21
@@
sub Html {
'<link rel="stylesheet" type="text/css" media="monochrome" href="/mono.css?1.11" title="light">',
);
'<link rel="stylesheet" type="text/css" media="monochrome" href="/mono.css?1.11" title="light">',
);
+ if (my $img = $meta->{image}) {
+ my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's');
+ my $url = "$proto$ENV{HTTP_HOST}/$img";
+ push @{ $meta->{raw} }, (
+ qq(<meta property="og:image" content="$url" />),
+ );
+ }
+
my ($file) = $ENV{SCRIPT_FILENAME} =~ m{ ([^/]+) \.plp$ }x;
my ($file) = $ENV{SCRIPT_FILENAME} =~ m{ ([^/]+) \.plp$ }x;
+ if (my $url = $meta->{canonical} // "/$file/$Request") {
+ $url = "https://sheet.shiar.nl$url";
+ push @{ $meta->{raw} }, qq(<link rel="canonical" href="$url" />);
+ }
+
PLP_START {
# leading output
say '<!DOCTYPE html>';
PLP_START {
# leading output
say '<!DOCTYPE html>';