Shared code to ascertain absolute urls.
'<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;
PLP_START {
my $pageinfo = $subpages{$Request}
or Html(), Abort("Onbekende dierenpagina <q>$Request</q>", '404 request not found');
-my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's');
-my $preview = "$proto$ENV{HTTP_HOST}/dieren.jpg";
-
Html({
title => $pageinfo->{title}.' cheat sheet',
version => '1.1',
relatie vernoemd vernoeming combinatie samenstelling voorvoegsel onverwant
land zee lucht animals dutch language
'],
+ image => 'dieren.jpg',
raw => <<"EOT",
-<meta property="og:image" content="$preview" />
<style>
figure[hidden] {
opacity: 0; /* secret */
<(common.inc.plp)><:
my $textinc = 'sample.txt';
-my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's');
-my $preview = "$proto$ENV{HTTP_HOST}/sample.png";
Html({
title => "unicode sampler",
version => '2.1',
stylesheet => [qw'light dark mono red'],
data => [$textinc],
- raw => qq(<meta property="og:image" content="$preview" />),
+ image => 'sample.png',
});
open my $source, '<', $textinc