commit 4ef6389c94b3f7a8c14b19efe77b826f71ae7bf3 parent 02a303e3b2f9de2612297491a5378d9b0a145628 Author: JayVii <jayvii[AT]posteo[DOT]de> Date: Sun, 27 Oct 2024 17:24:33 +0100 feat: add icons to RSS feed Diffstat:
M | api/rss.php | | | 13 | ++++++++++--- |
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/api/rss.php b/api/rss.php @@ -46,10 +46,15 @@ usort($notes, "sort_by_time"); /* construct RSS URL */ - $my_url = htmlspecialchars( + $rssurl = htmlspecialchars( "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"] ); + /* construct icons URL */ + $icnurl = htmlspecialchars( + "https://" . $_SERVER["SERVER_NAME"] . "/assets/img/favicon" + ); + /* write RSS XML */ http_response_code(200); // success header('Content-Type: text/xml'); @@ -64,13 +69,15 @@ > <channel> <title><?php echo $user . "/" . $category; ?></title> -<link><?php echo $_SERVER["SERVER_NAME"]; ?></link> +<icon><?php echo $icnurl . "_32.png"; ?></icon> +<logo><?php echo $icnurl . ".png"; ?></logo> +<link><?php echo "https://" . $_SERVER["SERVER_NAME"] . "/"; ?></link> <description> Rememori notes in <?php echo $user . "/" . $category; ?> </description> <generator>rememori</generator> <lastBuildDate><?php echo date(DATE_ATOM, time()); ?></lastBuildDate> -<atom:link href="<?php echo $my_url; ?>" rel="self" type="application/rss+xml"/> +<atom:link href="<?php echo $rssurl; ?>" rel="self" type="application/rss+xml"/> <?php