nieuws/feed: include article teaser as summary
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 27 Jun 2019 22:28:30 +0000 (00:28 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 12 Jul 2019 02:18:16 +0000 (04:18 +0200)
nieuws/feed/index.php

index 72c22074c2af16b1649620522a3225ba26457fca..66855b149e88e1c8dfaf130bae47eebcf2c3217b 100644 (file)
@@ -30,9 +30,10 @@ foreach ($pages as $i => $page) {
                <title><?= $article->title ?></title>
                <published><?= $article->dateiso ?></published>
                <updated><?= $article->dateiso ?></updated>
-               <content type="html"><?= htmlspecialchars($article->story) ?>
-               </content>
 <?php
+       if ($article->teaser) {
+               printf("\t\t<summary>%s</summary>\n", htmlspecialchars($article->teaser));
+       }
        if ($article->thumb) {
                printf("\t\t".'<link rel="enclosure" type="%s" href="%s"%s />'."\n",
                        'image/jpeg',
@@ -41,6 +42,8 @@ foreach ($pages as $i => $page) {
                );
        }
 ?>
+               <content type="html"><?= htmlspecialchars($article->story) ?>
+               </content>
        </entry>
 <?php
 }