From 57cc101f9eb50148a50dd173c05cfcbded760e15 Mon Sep 17 00:00:00 2001 From: Lorenzo Iovino Date: Thu, 26 Nov 2026 10:00:24 +0100 Subject: [PATCH] feat: il feed RSS non usa piu' XSLT, pagina /feed vera e URL del feed corretto --- public/rss-styles.xsl | 234 ------------------------------------ src/components/Footer.astro | 2 +- src/pages/feed.astro | 107 +++++++++++++++++ src/pages/rss.xml.ts | 1 - 4 files changed, 108 insertions(+), 236 deletions(-) delete mode 100644 public/rss-styles.xsl create mode 100644 src/pages/feed.astro diff --git a/public/rss-styles.xsl b/public/rss-styles.xsl deleted file mode 100644 index d7ca316..0000000 --- a/public/rss-styles.xsl +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - <xsl:value-of select="/rss/channel/title"/> - RSS Feed - - - -
-
-

📡

-

-
- -
-

🎯 What is an RSS Feed?

-

- This is an RSS feed. It allows you to subscribe to updates from this blog using an RSS reader. - Copy the URL /rss.xml and paste it into your favorite RSS reader to stay updated! -

- -
- -
-

Recent Posts ()

- -
-
- - - - - - -
- -
- -
-
-
-
- - -
- - -
-
diff --git a/src/components/Footer.astro b/src/components/Footer.astro index ed0808e..fe4da31 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -18,7 +18,7 @@ const maxWidth = width === "7xl" ? "max-w-7xl" : "max-w-4xl"; >
diff --git a/src/pages/feed.astro b/src/pages/feed.astro new file mode 100644 index 0000000..7bfc06f --- /dev/null +++ b/src/pages/feed.astro @@ -0,0 +1,107 @@ +--- +import type { CollectionEntry } from "astro:content"; +import { getCollection } from "astro:content"; +import { isPublished } from "../utils/posts"; +import Footer from "../components/Footer.astro"; +import Navbar from "../components/Navbar.astro"; +import BaseLayout from "../layouts/BaseLayout.astro"; + +type BlogPost = CollectionEntry<"blog">; + +const FEED_URL = "https://lorenzoiovino.com/rss.xml"; + +const allPosts: BlogPost[] = await getCollection("blog"); +const posts: BlogPost[] = allPosts + .filter((post: BlogPost) => isPublished(post)) + .sort((a: BlogPost, b: BlogPost) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); +--- + + + +
+
+
+

RSS Feed

+

+ Follow the blog with your favorite feed reader +

+
+
+ +
+ +

+ Recent Posts ({posts.length}) +

+
+ { + posts.map((post: BlogPost) => ( +
+
+ + {post.data.tags.length > 0 && ( + <> + • +
+ {post.data.tags.map((tag: string) => ( + + {tag} + + ))} +
+ + )} +
+

+ + {post.data.title} + +

+

{post.data.description}

+
+ )) + } +
+
+
+