keyboard: uniform title syntax
[sheet.git] / common.inc.plp
index 2976cbe37cd07615b1f9073d9fc332b403e19e24..9d341284e1ba20869e2634d695c23ace8f52c6c7 100644 (file)
@@ -147,8 +147,21 @@ sub Html {
                '<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;
 
+       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>';