From: Cameron Otsuka Date: Fri, 21 Nov 2025 01:31:05 +0000 (-0800) Subject: genericize podcast section naming X-Git-Url: https://git.otsuka.systems/?a=commitdiff_plain;h=c7baff06f06b30cdd61098ffa25a71ae511fac9a;p=cotsuka.github.io genericize podcast section naming --- diff --git a/content/build-weekly-roundup/2025-04.md b/content/podcasts/2025-04.md similarity index 100% rename from content/build-weekly-roundup/2025-04.md rename to content/podcasts/2025-04.md diff --git a/content/build-weekly-roundup/2025-05.md b/content/podcasts/2025-05.md similarity index 100% rename from content/build-weekly-roundup/2025-05.md rename to content/podcasts/2025-05.md diff --git a/content/build-weekly-roundup/2025-06.mdx b/content/podcasts/2025-06.mdx similarity index 100% rename from content/build-weekly-roundup/2025-06.mdx rename to content/podcasts/2025-06.mdx diff --git a/content/build-weekly-roundup/2025-07.mdx b/content/podcasts/2025-07.mdx similarity index 100% rename from content/build-weekly-roundup/2025-07.mdx rename to content/podcasts/2025-07.mdx diff --git a/content/build-weekly-roundup/2025-08.mdx b/content/podcasts/2025-08.mdx similarity index 100% rename from content/build-weekly-roundup/2025-08.mdx rename to content/podcasts/2025-08.mdx diff --git a/content/build-weekly-roundup/2025-11.mdx b/content/podcasts/2025-11.mdx similarity index 100% rename from content/build-weekly-roundup/2025-11.mdx rename to content/podcasts/2025-11.mdx diff --git a/content/build-weekly-roundup/2025-12.mdx b/content/podcasts/2025-12.mdx similarity index 100% rename from content/build-weekly-roundup/2025-12.mdx rename to content/podcasts/2025-12.mdx diff --git a/content/build-weekly-roundup/2025-14.mdx b/content/podcasts/2025-14.mdx similarity index 100% rename from content/build-weekly-roundup/2025-14.mdx rename to content/podcasts/2025-14.mdx diff --git a/content/build-weekly-roundup/2025-15.mdx b/content/podcasts/2025-15.mdx similarity index 100% rename from content/build-weekly-roundup/2025-15.mdx rename to content/podcasts/2025-15.mdx diff --git a/content/build-weekly-roundup/2025-17.mdx b/content/podcasts/2025-17.mdx similarity index 100% rename from content/build-weekly-roundup/2025-17.mdx rename to content/podcasts/2025-17.mdx diff --git a/content/build-weekly-roundup/2025-18.mdx b/content/podcasts/2025-18.mdx similarity index 100% rename from content/build-weekly-roundup/2025-18.mdx rename to content/podcasts/2025-18.mdx diff --git a/content/build-weekly-roundup/2025-19.mdx b/content/podcasts/2025-19.mdx similarity index 100% rename from content/build-weekly-roundup/2025-19.mdx rename to content/podcasts/2025-19.mdx diff --git a/content/build-weekly-roundup/2025-20.mdx b/content/podcasts/2025-20.mdx similarity index 100% rename from content/build-weekly-roundup/2025-20.mdx rename to content/podcasts/2025-20.mdx diff --git a/content/build-weekly-roundup/2025-21.mdx b/content/podcasts/2025-21.mdx similarity index 100% rename from content/build-weekly-roundup/2025-21.mdx rename to content/podcasts/2025-21.mdx diff --git a/content/build-weekly-roundup/2025-23.mdx b/content/podcasts/2025-23.mdx similarity index 100% rename from content/build-weekly-roundup/2025-23.mdx rename to content/podcasts/2025-23.mdx diff --git a/content/build-weekly-roundup/2025-24.mdx b/content/podcasts/2025-24.mdx similarity index 100% rename from content/build-weekly-roundup/2025-24.mdx rename to content/podcasts/2025-24.mdx diff --git a/content/build-weekly-roundup/2025-25.mdx b/content/podcasts/2025-25.mdx similarity index 100% rename from content/build-weekly-roundup/2025-25.mdx rename to content/podcasts/2025-25.mdx diff --git a/content/build-weekly-roundup/2025-26.mdx b/content/podcasts/2025-26.mdx similarity index 100% rename from content/build-weekly-roundup/2025-26.mdx rename to content/podcasts/2025-26.mdx diff --git a/content/build-weekly-roundup/2025-29.mdx b/content/podcasts/2025-29.mdx similarity index 100% rename from content/build-weekly-roundup/2025-29.mdx rename to content/podcasts/2025-29.mdx diff --git a/content/build-weekly-roundup/2025-30.mdx b/content/podcasts/2025-30.mdx similarity index 100% rename from content/build-weekly-roundup/2025-30.mdx rename to content/podcasts/2025-30.mdx diff --git a/content/build-weekly-roundup/2025-33.mdx b/content/podcasts/2025-33.mdx similarity index 100% rename from content/build-weekly-roundup/2025-33.mdx rename to content/podcasts/2025-33.mdx diff --git a/content/build-weekly-roundup/2025-36.mdx b/content/podcasts/2025-36.mdx similarity index 100% rename from content/build-weekly-roundup/2025-36.mdx rename to content/podcasts/2025-36.mdx diff --git a/content/build-weekly-roundup/2025-37.mdx b/content/podcasts/2025-37.mdx similarity index 100% rename from content/build-weekly-roundup/2025-37.mdx rename to content/podcasts/2025-37.mdx diff --git a/content/build-weekly-roundup/2025-38.mdx b/content/podcasts/2025-38.mdx similarity index 100% rename from content/build-weekly-roundup/2025-38.mdx rename to content/podcasts/2025-38.mdx diff --git a/content/build-weekly-roundup/2025-39.mdx b/content/podcasts/2025-39.mdx similarity index 100% rename from content/build-weekly-roundup/2025-39.mdx rename to content/podcasts/2025-39.mdx diff --git a/content/build-weekly-roundup/2025-40.mdx b/content/podcasts/2025-40.mdx similarity index 100% rename from content/build-weekly-roundup/2025-40.mdx rename to content/podcasts/2025-40.mdx diff --git a/content/build-weekly-roundup/2025-41.mdx b/content/podcasts/2025-41.mdx similarity index 100% rename from content/build-weekly-roundup/2025-41.mdx rename to content/podcasts/2025-41.mdx diff --git a/content/build-weekly-roundup/2025-42.mdx b/content/podcasts/2025-42.mdx similarity index 100% rename from content/build-weekly-roundup/2025-42.mdx rename to content/podcasts/2025-42.mdx diff --git a/content/build-weekly-roundup/2025-43.mdx b/content/podcasts/2025-43.mdx similarity index 100% rename from content/build-weekly-roundup/2025-43.mdx rename to content/podcasts/2025-43.mdx diff --git a/content/build-weekly-roundup/2025-44.mdx b/content/podcasts/2025-44.mdx similarity index 100% rename from content/build-weekly-roundup/2025-44.mdx rename to content/podcasts/2025-44.mdx diff --git a/content/build-weekly-roundup/2025-45.mdx b/content/podcasts/2025-45.mdx similarity index 100% rename from content/build-weekly-roundup/2025-45.mdx rename to content/podcasts/2025-45.mdx diff --git a/content/build-weekly-roundup/2025-46.mdx b/content/podcasts/2025-46.mdx similarity index 100% rename from content/build-weekly-roundup/2025-46.mdx rename to content/podcasts/2025-46.mdx diff --git a/src/components/metadata.astro b/src/components/metadata.astro index 9f8a306..4114d68 100644 --- a/src/components/metadata.astro +++ b/src/components/metadata.astro @@ -4,7 +4,7 @@ import { formatDate } from '@utils/format.ts'; 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; diff --git a/src/content.config.ts b/src/content.config.ts index ced51c0..ea430e7 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -13,8 +13,8 @@ const articles = defineCollection({ }) }); -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(), @@ -47,4 +47,4 @@ const reviews = defineCollection({ }) }); -export const collections = { articles, roundups, reviews }; \ No newline at end of file +export const collections = { articles, podcasts, reviews }; \ No newline at end of file diff --git a/src/pages/build-weekly-roundup/[id]/index.astro b/src/pages/build-weekly-roundup/[id]/index.astro deleted file mode 100644 index f354468..0000000 --- a/src/pages/build-weekly-roundup/[id]/index.astro +++ /dev/null @@ -1,31 +0,0 @@ ---- -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); ---- -
-

{roundup.data.title}

- - -
\ No newline at end of file diff --git a/src/pages/build-weekly-roundup/index.astro b/src/pages/build-weekly-roundup/index.astro deleted file mode 100644 index abbbfc2..0000000 --- a/src/pages/build-weekly-roundup/index.astro +++ /dev/null @@ -1,23 +0,0 @@ ---- -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()); ---- - - -

Build Weekly Roundup

-
- {sortedRoundups.map((roundup) => { - const date = formatDate(roundup.data.date); - return ( -
{roundup.data.title}
-
- {roundup.data.description} -
- ) - })} -
- \ No newline at end of file diff --git a/src/pages/feed.xml.ts b/src/pages/feed.xml.ts index 7cee878..583feb1 100644 --- a/src/pages/feed.xml.ts +++ b/src/pages/feed.xml.ts @@ -13,13 +13,13 @@ export async function GET(context: any) { 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'); @@ -31,7 +31,7 @@ export async function GET(context: any) { 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, diff --git a/src/pages/podcasts/[id]/index.astro b/src/pages/podcasts/[id]/index.astro new file mode 100644 index 0000000..074351f --- /dev/null +++ b/src/pages/podcasts/[id]/index.astro @@ -0,0 +1,31 @@ +--- +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); +--- +
+

{podcast.data.title}

+ + +
\ No newline at end of file diff --git a/src/pages/build-weekly-roundup/[id]/opengraph.png.ts b/src/pages/podcasts/[id]/opengraph.png.ts similarity index 92% rename from src/pages/build-weekly-roundup/[id]/opengraph.png.ts rename to src/pages/podcasts/[id]/opengraph.png.ts index c376dd4..2d042cd 100644 --- a/src/pages/build-weekly-roundup/[id]/opengraph.png.ts +++ b/src/pages/podcasts/[id]/opengraph.png.ts @@ -4,10 +4,10 @@ import { ImageResponse } from '@vercel/og'; 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 }, })); }; @@ -45,7 +45,7 @@ export const GET: APIRoute = async ({ props }) => { fontWeight: 600, marginBottom: 20, }, - children: props.roundup.data.title, + children: props.podcast.data.title, }, }, { @@ -55,7 +55,7 @@ export const GET: APIRoute = async ({ props }) => { fontSize: 32, marginBottom: 40, }, - children: props.roundup.data.description, + children: props.podcast.data.description, }, }, { diff --git a/src/pages/podcasts/index.astro b/src/pages/podcasts/index.astro new file mode 100644 index 0000000..26c89e9 --- /dev/null +++ b/src/pages/podcasts/index.astro @@ -0,0 +1,23 @@ +--- +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()); +--- + + +

Podcasts

+
+ {sortedPodcasts.map((podcast) => { + const date = formatDate(podcast.data.date); + return ( +
{podcast.data.title}
+
+ {podcast.data.description} +
+ ) + })} +
+ \ No newline at end of file diff --git a/src/utils/globals.ts b/src/utils/globals.ts index 89ac40e..5e78b05 100644 --- a/src/utils/globals.ts +++ b/src/utils/globals.ts @@ -6,7 +6,7 @@ export const siteAuthor = { } 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" } ];