1
0
Fork 0

populate /blog/#articles from a handmade Atom feed

This commit is contained in:
will 2023-02-16 09:32:26 -07:00
parent e284bbff1b
commit 164a3a8f0b
3 changed files with 78 additions and 13 deletions

59
blog/blog.atom Normal file
View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>will's blog</title>
<id>https://isopod.cool/blog/</id>
<link rel="alternate" href="https://isopod.cool/blog/"></link>
<updated>2023-01-12T00:00:00+00:00</updated>
<author>
<name>Will</name>
<uri>https://isopod.cool/</uri>
</author>
<entry>
<title>Guide - Things I Keep Having To Google</title>
<id>guide_things_i_keep_having_to_google</id>
<link rel="alternate" href="https://isopod.cool/blog/posts/guide_things_i_keep_having_to_google/" type="html" title="Guide - Things I Keep Having To Google"></link>
<published>2023-01-12T00:00:00+00:00</published>
<updated>2023-01-12T00:00:00+00:00</updated>
<summary>A continually updating personal reference of random information I keep needing but keep forgetting.</summary>
</entry>
<entry>
<title>deeptwisty.com 2nd anniversary - A History of This Bullshit</title>
<id>deeptwistycom_2nd_anniversary_-_a_history_of_this_bullshit</id>
<link rel="alternate" href="https://isopod.cool/blog/posts/deeptwistycom_2nd_anniversary_-_a_history_of_this_bullshit/" type="html" title="deeptwisty.com 2nd anniversary - A History of This Bullshit"></link>
<published>2022-09-19T00:00:00+00:00</published>
<updated>2022-09-19T00:00:00+00:00</updated>
<summary>An abridged history of my presence on the World Wide Web, from my first customized Tumblr pages to now.</summary>
</entry>
<entry>
<title>Guide - Self-Host Safely with WireGuard</title>
<id>guide_self_host_safely_with_wireguard</id>
<link rel="alternate" href="https://isopod.cool/blog/posts/guide_self_host_safely_with_wireguard/" type="html" title="Guide - Self-Host Safely with WireGuard"></link>
<published>2022-08-25T00:00:00+00:00</published>
<updated>2022-08-25T00:00:00+00:00</updated>
<summary>A basic guide on connecting two Linux servers via WireGuard to make one publically accessible through the other.</summary>
</entry>
<entry>
<title>Late May Updates</title>
<id>Late_May_Updates</id>
<link rel="alternate" href="https://isopod.cool/old/2/?page=blog#Late_May_Updates" type="html" title="Late May Updates"></link>
<published>2022-05-21T00:00:00+00:00</published>
<updated>2022-05-21T00:00:00+00:00</updated>
<summary>In which I discuss my evolving understanding of my sexuality, among other miscellaneous updates.</summary>
</entry>
<entry>
<title>Second</title>
<id>Second</id>
<link rel="alternate" href="https://isopod.cool/old/2/?page=blog#Second" type="html" title="Second"></link>
<published>2022-04-25T00:00:00+00:00</published>
<updated>2022-04-25T00:00:00+00:00</updated>
<summary>A rant about the world's worst game that I think you should play.</summary>
</entry>
<entry>
<title>First</title>
<id>First</id>
<link rel="alternate" href="https://isopod.cool/old/2/?page=blog#First" type="html" title="First"></link>
<published>2022-04-13T00:00:00+00:00</published>
<updated>2022-04-13T00:00:00+00:00</updated>
<summary>I've got a blog now!</summary>
</entry>
</feed>

View file

@ -40,7 +40,7 @@
<h1>blog</h1> <h1>blog</h1>
<h2 id="caption">inane ramblings</h2> <h2 id="caption">inane ramblings</h2>
<nav> <nav>
<a href="https://blog.miso.town/atom?url=https://isopod.cool/blog/">Atom (articles)</a> <a href="blog.atom">Atom (articles)</a>
<a href="https://journal.miso.town/atom?url=https://isopod.cool/blog/">Atom (journal)</a> <a href="https://journal.miso.town/atom?url=https://isopod.cool/blog/">Atom (journal)</a>
</nav> </nav>
<?php <?php
@ -65,16 +65,22 @@
} }
echo "<div id='statuscafe'><div id='statuscafe-username'><a href='https://status.cafe/users/$username' target='_blank'>status</a> $face $timeago</div><div id='statuscafe-content'>$content</div></div>"; echo "<div id='statuscafe'><div id='statuscafe-username'><a href='https://status.cafe/users/$username' target='_blank'>status</a> $face $timeago</div><div id='statuscafe-content'>$content</div></div>";
?> ?>
<ul id="articles"> <?php
<li><h2>2023</h2></li> $content = simplexml_load_file("blog.atom");
<li><time datetime="2023-01-12 5:37">2023-01-12</time> <a href="posts/guide_things_i_keep_having_to_google/">Guide - Things I Keep Having To Google</a></li> echo "<ul id='articles'>";
<li><h2>2022</h2></li> $year = "-69420";
<li><time datetime="2022-09-19 1:18">2022-09-19</time> <a href="posts/deeptwistycom_2nd_anniversary_-_a_history_of_this_bullshit/">deeptwisty.com 2nd anniversary - A History of This Bullshit</a></li> foreach($content->entry as $entry) {
<li><time datetime="2022-08-25 8:04">2022-08-25</time> <a href="posts/guide_self_host_safely_with_wireguard/">Guide - Self-Host Safely with WireGuard</a></li>
<li><time datetime="2022-05-21 0:00">2022-05-21</time> <a href="https://isopod.cool/old/2/?page=blog#Late_May_Updates">Late May Updates</a></li> $nyr = substr($entry->published, 0, 4);
<li><time datetime="2022-04-25 0:00">2022-04-25</time> <a href="https://isopod.cool/old/2/?page=blog#Second">Second</a></li> if($nyr != $year) {
<li><time datetime="2022-04-13 6:00">2022-04-13</time> <a href="https://isopod.cool/old/2/?page=blog#First">First</a></li> $year = $nyr;
</ul> echo "<li><h2>$year</h2></li>";
}
echo "<li><time>".substr($entry->published, 0, 10)."</time> <a href='".$entry->link[href]."'>".$entry->title."</a></li>";
}
echo "</ul>";
?>
<article id="2023-02-07"> <article id="2023-02-07">
<h2>2023-02-09</h2> <h2>2023-02-09</h2>
<p>I've deprecated the changelog on my website in favor of just linking an RSS feed of my <a href="https://git.isopod.cool/will/isopod.cool/commits/branch/main">git commits</a> to it. Strictly speaking this is probably a worse user experience, but it's my website and I'm too lazy to keep maintaining two changelogs. Figured I'd announce it here in case someone is regularly checking on the changelog but isn't subscribed to its Atom feed and is curious what happened.</p> <p>I've deprecated the changelog on my website in favor of just linking an RSS feed of my <a href="https://git.isopod.cool/will/isopod.cool/commits/branch/main">git commits</a> to it. Strictly speaking this is probably a worse user experience, but it's my website and I'm too lazy to keep maintaining two changelogs. Figured I'd announce it here in case someone is regularly checking on the changelog but isn't subscribed to its Atom feed and is curious what happened.</p>

View file

@ -84,7 +84,7 @@ if($feed // A basic check to m
echo $content->channel->pubDate->asXML(); echo $content->channel->pubDate->asXML();
echo $content->channel->lastBuildDate->asXML(); echo $content->channel->lastBuildDate->asXML();
echo $content->channel->docs->asXML(); echo $content->channel->docs->asXML();
echo "<generator>niceopod's RSS filter script</generator>"; echo "<generator>will's RSS filter script</generator>";
echo $content->channel->managingEditor->asXML(); echo $content->channel->managingEditor->asXML();
echo $content->channel->webMaster->asXML(); echo $content->channel->webMaster->asXML();
@ -115,7 +115,7 @@ if($feed // A basic check to m
foreach($content->contributor as $contributor) { foreach($content->contributor as $contributor) {
echo $contributor->asXML(); echo $contributor->asXML();
} }
echo "<generator>niceopod's Atom filter script</generator>"; echo "<generator>will's Atom filter script</generator>";
echo $content->icon->asXML(); echo $content->icon->asXML();
echo $content->logo->asXML(); echo $content->logo->asXML();
echo $content->rights->asXML(); echo $content->rights->asXML();