head: use page teaser as meta description
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 27 Jun 2019 22:27:00 +0000 (00:27 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 12 Jul 2019 02:18:16 +0000 (04:18 +0200)
head.inc.php
nieuws/index.php

index 68ec4ca96f08789b20cd815aaccd9f945e14062f..72cbf36024f721ef6b92fb669094b48ab98ac25e 100644 (file)
@@ -5,8 +5,8 @@
 <?php if ($Article->title) { ?>
        <title><?= htmlspecialchars($Article->safetitle) ?></title>
 <?php } ?>
-<?php if (!empty($Place['description'])) { ?>
-       <meta name="description" property="og:description" content="<?= strip_tags($Place['description']) ?>" />
+<?php if ($Article->teaser) { ?>
+       <meta name="description" property="og:description" content="<?= strip_tags($Article->teaser) ?>" />
 <?php } ?>
        <meta name="viewport" content="width=device-width" />
        <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script><![endif]-->
index 0f81de28edcf428bd5dacdc1fa6a945b5751fbe9..8b82b61fb6f4b15a8b25ae9ce6028f295a6eedcf 100644 (file)
@@ -11,9 +11,6 @@ if ($page and !is_numeric($page)) {
        if ($edit) {
                $Article->title = $edit;
        }
-       if (isset($Article->raw)) {
-               $Place['description'] = $Article->teaser;
-       }
        $Place[1] = ' <small class="date">'.$Article->date.'</small>';
        print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
        if ($User and $User->admin) {