Skip to content

Commit ee7cbfa

Browse files
committed
add new post
1 parent 59b3147 commit ee7cbfa

10 files changed

+555
-478
lines changed

lib/mix/tasks/rss.ex

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ defmodule Mix.Tasks.Rss do
33
alias Personal.Blog
44
import Personal
55

6-
use Phoenix.Component
7-
import Phoenix.HTML
8-
96
@destination "output/feed.xml"
107

118
@impl Mix.Task

output/atom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
<title>andyleclair.dev</title>
44
<link href="http://localhost:4000/" />
55
<link href="http://localhost:4000/atom.xml" rel="self" />
6-
<updated>2024-11-15T00:00:00-05:00</updated>
6+
<updated>2024-12-30T00:00:00-05:00</updated>
77
<author>
88
<name>Andy LeClair</name>
99
</author>
1010
<id>http://localhost:4000/</id>
1111

1212
<entry>
13+
<title>Adding RSS to a static site</title>
14+
<link href="http://localhost:4000/posts/2024/12-30-adding-rss-to-a-static-site.html" />
15+
<id>http://localhost:4000/posts/2024/12-30-adding-rss-to-a-static-site.html</id>
16+
<updated>2024-12-30T00:00:00-05:00</updated>
17+
<summary>Adding RSS and Atom feeds to this site</summary>
18+
</entry>
19+
<entry>
1320
<title>How To Do A Preload Good</title>
1421
<link href="http://localhost:4000/posts/2024/11-15-how-to-do-a-preload-good.html" />
1522
<id>http://localhost:4000/posts/2024/11-15-how-to-do-a-preload-good.html</id>

output/feed.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
<link>http://localhost:4000/</link>
77
<atom:link href="http://localhost:4000/rss.xml" rel="self" type="application/rss+xml" />
88
<item>
9+
<title>Adding RSS to a static site</title>
10+
<description>Adding RSS and Atom feeds to this site</description>
11+
<pubDate>Mon, 30 Dec 2024 00:00:00 EST</pubDate>
12+
<link>http://localhost:4000/posts/2024/12-30-adding-rss-to-a-static-site.html</link>
13+
<guid isPermaLink="true">http://localhost:4000/posts/2024/12-30-adding-rss-to-a-static-site.html</guid>
14+
</item>
15+
<item>
916
<title>How To Do A Preload Good</title>
1017
<description>Avoiding N+1 queries with Ecto's preload</description>
1118
<pubDate>Fri, 15 Nov 2024 00:00:00 EST</pubDate>

output/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ <h1>andy@andyleclair.dev$><span class="blink">_</span></h1>
2121
<h2 class="text-xl">Blog!</h2>
2222
<ul>
2323
<li>
24+
2024-12-30 - <a href="posts/2024/12-30-adding-rss-to-a-static-site.html">Adding RSS to a static site</a>
25+
</li><li>
2426
2024-11-15 - <a href="posts/2024/11-15-how-to-do-a-preload-good.html">How To Do A Preload Good</a>
2527
</li><li>
2628
2024-10-28 - <a href="posts/2024/10-28-live-fridge.html">Live Fridge</a>

output/posts/2024/09-09-gltest.html

Lines changed: 174 additions & 174 deletions
Large diffs are not rendered by default.

output/posts/2024/09-10-opengl-part-2.html

Lines changed: 96 additions & 96 deletions
Large diffs are not rendered by default.

output/posts/2024/09-11-opengl-part-3.html

Lines changed: 181 additions & 181 deletions
Large diffs are not rendered by default.

output/posts/2024/11-15-how-to-do-a-preload-good.html

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="/assets/app.css">
7+
<script type="text/javascript" src="/assets/app.js"></script>
8+
9+
<title>Adding RSS to a static site</title>
10+
<meta name="description" content="Adding RSS and Atom feeds to this site">
11+
12+
</head>
13+
14+
<body class="bg-nor-easter text-smurf-blood">
15+
<div class="flex h-60 min-h-screen flex-col items-center">
16+
<header class="bg-bludacris p-10 my-4 lg:mt-10 lg:mb-14">
17+
<h1>andy@andyleclair.dev$><span class="blink">_</span></h1>
18+
</header>
19+
<main class="relative grow min-h-96 flex-1 p-4">
20+
21+
<article class="prose lg:prose-xl prose-pre:bg-codebg">
22+
<h1>Adding RSS to a static site</h1>
23+
<h3>Adding RSS and Atom feeds to this site</h3>
24+
<h3><a href="https://www.youtube.com/watch?v=rVpR_WTRhmc">Related Listening</a></h3>
25+
<p class="text-smurf-blood">Posted on 2024-12-30</p>
26+
<p>
27+
At the prompting of <a href="https://github.com/andyleclair/andyleclair.github.io/issues/1">this github issue</a>, I’ve added RSS and Atom feeds to this site.</p>
28+
<p>
29+
Overall this was pretty easy to get something working! Since this site is just static files deployed to Github Pages, I just built some XML as strings in Elixir and wrote them to disk. EZPZ! However, this happens to be <em>my</em> blog and if I’m gonna do anything, I’d rather do it the <em>fun</em> way.</p>
30+
<p>
31+
I’d like to see if I can get it to work using HEEX templates. Then, I think it should be reasonably easy to make a simple knock-off of <code class="inline">Phoenix.VerifiedRoutes</code> that just gets the “routes” from the list of <code class="inline">Posts</code>. Right now I’ve got a simple <code class="inline">url</code> helper that gives me a hard-coded absolute URL, but I think having <code class="inline">~p</code> would be slick.</p>
32+
<p>
33+
I think it will also be the time I finally get around to having a real dev server that watches the filesystem for changes.</p>
34+
<p>
35+
I’m going to push what I have so far and close the issue, but I’ll be back with another post about getting fancy with the XML generation.</p>
36+
37+
</article>
38+
39+
</main>
40+
<footer class="bg-bludacris p-4 text-center">
41+
© Andy LeClair 2024 | <a href="/atom.xml">Atom</a> | <a href="/feed.xml">RSS</a>
42+
</footer>
43+
</div>
44+
</body>
45+
</html>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
%{
2+
title: "Adding RSS to a static site",
3+
description: "Adding RSS and Atom feeds to this site",
4+
author: "Andy LeClair",
5+
tags: ["elixir", "meta"],
6+
related_listening: "https://www.youtube.com/watch?v=rVpR_WTRhmc",
7+
}
8+
---
9+
10+
At the prompting of [this github issue](https://github.com/andyleclair/andyleclair.github.io/issues/1), I've added RSS and Atom feeds to this site.
11+
12+
Overall this was pretty easy to get something working! Since this site is just static files deployed to Github Pages, I just built some XML as strings in Elixir and wrote them to disk. EZPZ! However, this happens to be _my_ blog and if I'm gonna do anything, I'd rather do it the _fun_ way.
13+
14+
I'd like to see if I can get it to work using HEEX templates. Then, I think it should be reasonably easy to make a simple knock-off of `Phoenix.VerifiedRoutes` that just gets the "routes" from the list of `Posts`. Right now I've got a simple `url` helper that gives me a hard-coded absolute URL, but I think having `~p` would be slick.
15+
16+
I think it will also be the time I finally get around to having a real dev server that watches the filesystem for changes.
17+
18+
I'm going to push what I have so far and close the issue, but I'll be back with another post about getting fancy with the XML generation.
19+

0 commit comments

Comments
 (0)