head: indicate explicit og:type of website
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 16 May 2020 23:50:32 +0000 (01:50 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 17 May 2020 00:13:39 +0000 (02:13 +0200)
Include just to allow page overrides, such as "article" for nieuws pages
(might affect Facebook, but seems a minor and mostly useless distinction).
At least silences Dareboost warnings about required Open Graph properties.

head.inc.php
nieuws/index.php

index 797f611a0c5cb0a15db2592df9d4e7dfde48abeb..2b29afc41a6e135ba7b45b2540b017cb517264af 100644 (file)
@@ -13,6 +13,7 @@
 <?php if ($Article->image) { ?>
        <meta property="og:image" content="https://<?= $_SERVER['HTTP_HOST'] . '/' . htmlspecialchars($Article->thumb('640x')) ?>" />
 <?php } ?>
+       <meta property="og:type" content="<?= $Article->meta['og:type'] ?? 'website' ?>" />
        <meta property="og:url" content="https://<?= $_SERVER['HTTP_HOST'] . '/' . htmlspecialchars($Article->link) ?>" />
 </head>
 <body>
index c6234cfae29d6c98e97a14e6b0166e18e8b42fae..392a10fce64340c6e7f2cd80498f7ef797eb94ad 100644 (file)
@@ -7,6 +7,7 @@ if ($User and $User->admin("edit $Page")) {
 }
 
 if ($page and !is_numeric($page)) {
+       $Article->meta['og:type'] = 'article';
        $edit = $User && $User->admin("edit $Page$Args") ? htmlspecialchars(@$_GET['edit']) : NULL;
        if ($edit) {
                $Article->title = $edit;