Radio show website: Full Astro build with 194 episodes imported
Complete website for The Computer Guru Show (radio.azcomputerguru.com): - Astro 6.0.4 static site with React islands - 194 episodes imported from gurushow.com RSS feed - Dark/light mode HSL design system - Persistent audio player with session persistence - Episode archive with search and season filtering - Home page with animated hero, stats, latest episodes - All pages: About, Subscribe, Community, Live, Contact, Blog, 404 - Podcast RSS feed with iTunes namespace - Session log updated Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
37
projects/radio-show/website/src/pages/feed.xml.ts
Normal file
37
projects/radio-show/website/src/pages/feed.xml.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
import type { APIContext } from 'astro';
|
||||
|
||||
export async function GET(context: APIContext) {
|
||||
const episodes = await getCollection('episodes');
|
||||
const sortedEpisodes = episodes.sort(
|
||||
(a, b) =>
|
||||
new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime()
|
||||
);
|
||||
|
||||
return rss({
|
||||
title: 'The Computer Guru Show',
|
||||
description:
|
||||
'Technology: Fun and Simple. Hosted by Mike Swanson from Tucson, Arizona.',
|
||||
site: context.site!.toString(),
|
||||
items: sortedEpisodes.map((ep) => ({
|
||||
title: ep.data.title,
|
||||
pubDate: ep.data.pubDate,
|
||||
description: ep.body?.substring(0, 300) || ep.data.title,
|
||||
link: `/episodes/${ep.id}`,
|
||||
customData: `<enclosure url="${ep.data.audioUrl}" length="${ep.data.audioSize}" type="audio/mpeg"/>
|
||||
<itunes:duration>${ep.data.duration}</itunes:duration>
|
||||
<itunes:episode>${ep.data.episode}</itunes:episode>
|
||||
<itunes:season>${ep.data.season}</itunes:season>`,
|
||||
})),
|
||||
customData: `<language>en-us</language>
|
||||
<itunes:author>Mike Swanson</itunes:author>
|
||||
<itunes:category text="Technology"/>
|
||||
<itunes:image href="https://radio.azcomputerguru.com/og-image.jpg"/>
|
||||
<itunes:explicit>false</itunes:explicit>
|
||||
<itunes:type>episodic</itunes:type>`,
|
||||
xmlns: {
|
||||
itunes: 'http://www.itunes.com/dtds/podcast-1.0.dtd',
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user