import Rating from '@components/ui/rating.astro';
interface Props {
- entryData: InferEntrySchema<'articles'> | InferEntrySchema<'roundups'> | InferEntrySchema<'reviews'>
+ entryData: InferEntrySchema<'articles'> | InferEntrySchema<'podcasts'> | InferEntrySchema<'reviews'>
}
const { entryData } = Astro.props;
})
});
-const roundups = defineCollection({
- loader: glob({ pattern: '**/*.{md,mdx}', base: 'content/build-weekly-roundup' }),
+const podcasts = defineCollection({
+ loader: glob({ pattern: '**/*.{md,mdx}', base: 'content/podcasts' }),
schema: z.object({
title: z.string(),
href: z.string().url(),
})
});
-export const collections = { articles, roundups, reviews };
\ No newline at end of file
+export const collections = { articles, podcasts, reviews };
\ No newline at end of file
+++ /dev/null
----
-import { type CollectionEntry, getCollection, render } from 'astro:content';
-import Article from '@layouts/article.astro';
-import Metadata from '@components/metadata.astro';
-
-interface Props {
- roundup: CollectionEntry<'roundups'>
-}
-
-export async function getStaticPaths() {
- const roundups = await getCollection('roundups');
- return roundups.map(roundup => ({
- params: { id: roundup.id },
- props: { roundup },
- }));
-}
-
-const { roundup } = Astro.props;
-const { Content } = await render(roundup);
----
-<Article
- title={roundup.data.title}
- description={roundup.data.description}
- publishedTime={roundup.data.date.toISOString()}
- modifiedTime={roundup.data.modified ? roundup.data.modified.toISOString() : roundup.data.date.toISOString()}
- tags={roundup.data.tags}
->
- <a href={roundup.data.href}><h2>{roundup.data.title}</h2></a>
- <Metadata entryData={roundup.data} />
- <Content />
-</Article>
\ No newline at end of file
+++ /dev/null
----
-import { getCollection } from 'astro:content';
-import { formatDate } from '@utils/format.ts';
-import Base from '@layouts/base.astro';
-
-const roundups = await getCollection('roundups');
-const sortedRoundups = roundups.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
----
-
-<Base title="Build Weekly Roundup" description="Description">
- <h2>Build Weekly Roundup</h2>
- <dl>
- {sortedRoundups.map((roundup) => {
- const date = formatDate(roundup.data.date);
- return (
- <dt><a href={`/build-weekly-roundup/${roundup.id}/`}>{roundup.data.title}</a></dt>
- <dd>
- {roundup.data.description}
- </dd>
- )
- })}
- </dl>
-</Base>
\ No newline at end of file
categories: (article.data.tags ?? []).concat('articles')
}));
- const roundups = await getCollection('roundups');
- const roundupItems = roundups.map((roundup) => ({
- title: roundup.data.title,
- link: `/build-weekly-roundup/${roundup.id}/`,
- pubDate: roundup.data.date,
- description: roundup.data.description,
- categories: (roundup.data.tags ?? []).concat('roundups')
+ const podcasts = await getCollection('podcasts');
+ const podcastItems = podcasts.map((podcast) => ({
+ title: podcast.data.title,
+ link: `/podcasts/${podcast.id}/`,
+ pubDate: podcast.data.date,
+ description: podcast.data.description,
+ categories: (podcast.data.tags ?? []).concat('podcasts')
}));
const reviews = await getCollection('reviews');
categories: (review.data.tags ?? []).concat(review.data.type).concat('reviews')
}));
- const feedItems = [ ...articleItems, ...roundupItems, ...reviewItems ];
+ const feedItems = [ ...articleItems, ...podcastItems, ...reviewItems ];
const sortedFeedItems = feedItems.sort((a, b) => b.pubDate.getTime() - a.pubDate.getTime());
return rss({
title: siteTitle,
--- /dev/null
+---
+import { type CollectionEntry, getCollection, render } from 'astro:content';
+import Article from '@layouts/article.astro';
+import Metadata from '@components/metadata.astro';
+
+interface Props {
+ podcast: CollectionEntry<'podcasts'>
+}
+
+export async function getStaticPaths() {
+ const podcasts = await getCollection('podcasts');
+ return podcasts.map(podcast => ({
+ params: { id: podcast.id },
+ props: { podcast },
+ }));
+}
+
+const { podcast } = Astro.props;
+const { Content } = await render(podcast);
+---
+<Article
+ title={podcast.data.title}
+ description={podcast.data.description}
+ publishedTime={podcast.data.date.toISOString()}
+ modifiedTime={podcast.data.modified ? podcast.data.modified.toISOString() : podcast.data.date.toISOString()}
+ tags={podcast.data.tags}
+>
+ <a href={podcast.data.href}><h2>{podcast.data.title}</h2></a>
+ <Metadata entryData={podcast.data} />
+ <Content />
+</Article>
\ No newline at end of file
import { siteAuthor } from '@utils/globals.ts';
export async function getStaticPaths() {
- const roundups = await getCollection('roundups');
- return roundups.map(roundup => ({
- params: { id: roundup.id },
- props: { roundup },
+ const podcasts = await getCollection('podcasts');
+ return podcasts.map(podcast => ({
+ params: { id: podcast.id },
+ props: { podcast },
}));
};
fontWeight: 600,
marginBottom: 20,
},
- children: props.roundup.data.title,
+ children: props.podcast.data.title,
},
},
{
fontSize: 32,
marginBottom: 40,
},
- children: props.roundup.data.description,
+ children: props.podcast.data.description,
},
},
{
--- /dev/null
+---
+import { getCollection } from 'astro:content';
+import { formatDate } from '@utils/format.ts';
+import Base from '@layouts/base.astro';
+
+const podcasts = await getCollection('podcasts');
+const sortedPodcasts = podcasts.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
+---
+
+<Base title="Podcasts" description="Description">
+ <h2>Podcasts</h2>
+ <dl>
+ {sortedPodcasts.map((podcast) => {
+ const date = formatDate(podcast.data.date);
+ return (
+ <dt><a href={`/podcasts/${podcast.id}/`}>{podcast.data.title}</a></dt>
+ <dd>
+ {podcast.data.description}
+ </dd>
+ )
+ })}
+ </dl>
+</Base>
\ No newline at end of file
}
export const menuItems: {title: string, url: string}[] = [
- { "title": "Podcast", "url": "/build-weekly-roundup" },
+ { "title": "Podcasts", "url": "/podcasts" },
{ "title": "Articles", "url": "/articles" },
{ "title": "Reviews", "url": "/reviews" }
];