summaryrefslogtreecommitdiff
path: root/feed.php
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-07-28 10:58:58 -0400
committer53hornet <atc@53hor.net>2021-07-28 10:58:58 -0400
commitbfaccc32571df8a02f69518d8864244efba3b5b5 (patch)
treecc71a44054af00e73d0db2a1c79c347db3f31327 /feed.php
parentdd75b4a341925e4ba3408b018941241d4317dd9f (diff)
download53hor-bfaccc32571df8a02f69518d8864244efba3b5b5.tar.xz
53hor-bfaccc32571df8a02f69518d8864244efba3b5b5.zip
php site, templating and partials, faster index generation
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/feed.php b/feed.php
new file mode 100644
index 0000000..309f97e
--- /dev/null
+++ b/feed.php
@@ -0,0 +1,29 @@
+<?php header('content-type: application/rss+xml'); ?>
+
+<?xml version="1.0" encoding="utf-8"?>
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>53hornet's Feed</title>
+ <link>https://www.53hor.net</link>
+ <atom:link href="https://www.53hor.net/rss.xml" rel="self" type="application/rss+xml" />
+ <description>The World Wide Web pages of Adam Carpenter</description>
+ <image>
+ <url>https://www.53hor.net/includes/logo_diag.png</url>
+ <title>53hornet's Feed</title>
+ <link>https://www.53hor.net</link>
+ </image>
+ <?php
+ if ($posts = glob('./posts/*.php')) {
+ $early = true;
+
+ foreach (array_reverse($posts) as $post) {
+ if (!empty($post) && $post != '.' && $post != '..') {
+ $post_name = explode('/', $post)[2];
+ include($post);
+ printf('<item><link>https://www.53hor.net/posts/%s</link><title>%s</title></item>', $post_name, $title);
+ }
+ }
+ }
+ ?>
+ </channel>
+</rss>