featmigrate from Angular to Astro static site
BREAKING CHANGE: Complete rewrite from Angular SPA to Astro - Replace Angular 18 with Astro 5.16.7 + Tailwind CSS - Convert all Angular components to Astro components - Add content collections for blog with markdown support - Setup S3 deployment with CloudFront invalidation - Add RSS feed and sitemap generation - Configure Prettier and Biome for code formatting - Switch from npm to pnpm - Remove Amplify backend (now fully static) - Improve SEO and performance with static generation
This commit is contained in:
parent
cda19e8624
commit
69d5850f5b
191 changed files with 7821 additions and 21755 deletions
27
src/pages/rss.xml.ts
Normal file
27
src/pages/rss.xml.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import rss from "@astrojs/rss";
|
||||
import { getCollection } from "astro:content";
|
||||
import type { APIContext } from "astro";
|
||||
|
||||
export async function GET(context: APIContext) {
|
||||
const blog = await getCollection("blog");
|
||||
const publishedPosts = blog
|
||||
.filter((post) => !post.data.draft)
|
||||
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
||||
|
||||
return rss({
|
||||
title: "Lorenzo Iovino >> Blog",
|
||||
description:
|
||||
"Thoughts, experiences, and insights about software engineering, technology, and life by Lorenzo Iovino",
|
||||
site: context.site?.toString() || "https://lorenzoiovino.com",
|
||||
items: publishedPosts.map((post) => ({
|
||||
title: post.data.title,
|
||||
description: post.data.description,
|
||||
pubDate: post.data.pubDate,
|
||||
link: `/blog/${post.slug}/`,
|
||||
author: post.data.author || "Lorenzo Iovino",
|
||||
categories: post.data.tags,
|
||||
})),
|
||||
customData: `<language>en-us</language>`,
|
||||
stylesheet: "/rss-styles.xsl",
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue