head: title as og:name property, clean up description
[minimedit.git] / head.inc.php
1 <!DOCTYPE html>
2 <html lang="nl">
3 <head>
4         <meta charset="utf-8" />
5 <?php if ($Article->title) { ?>
6         <title property="og:name"><?= htmlspecialchars($Article->safetitle) ?></title>
7 <?php } ?>
8 <?php if ($Article->teaser) { ?>
9         <meta name="description" property="og:description" content="<?= preg_replace('/\s+/', ' ', strip_tags($Article->teaser)) ?>" />
10 <?php } ?>
11         <meta name="viewport" content="width=device-width" />
12         <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script><![endif]-->
13 <?php if ($Article->image) { ?>
14         <meta property="og:image" content="https://<?= $_SERVER['HTTP_HOST'] . '/' . htmlspecialchars($Article->thumb('640x')) ?>" />
15 <?php } ?>
16         <meta property="og:type" content="<?= $Article->meta['og:type'] ?? 'website' ?>" />
17         <meta property="og:url" content="https://<?= $_SERVER['HTTP_HOST'] . '/' . htmlspecialchars($Article->link) ?>" />
18 </head>
19 <body>