]> git.otsuka.systems Git - cotsuka.github.io/commitdiff
genericize podcast section naming
authorCameron Otsuka <cameron@otsuka.haus>
Fri, 21 Nov 2025 01:31:05 +0000 (17:31 -0800)
committerCameron Otsuka <cameron@otsuka.haus>
Fri, 21 Nov 2025 01:31:05 +0000 (17:31 -0800)
41 files changed:
content/podcasts/2025-04.md [moved from content/build-weekly-roundup/2025-04.md with 100% similarity]
content/podcasts/2025-05.md [moved from content/build-weekly-roundup/2025-05.md with 100% similarity]
content/podcasts/2025-06.mdx [moved from content/build-weekly-roundup/2025-06.mdx with 100% similarity]
content/podcasts/2025-07.mdx [moved from content/build-weekly-roundup/2025-07.mdx with 100% similarity]
content/podcasts/2025-08.mdx [moved from content/build-weekly-roundup/2025-08.mdx with 100% similarity]
content/podcasts/2025-11.mdx [moved from content/build-weekly-roundup/2025-11.mdx with 100% similarity]
content/podcasts/2025-12.mdx [moved from content/build-weekly-roundup/2025-12.mdx with 100% similarity]
content/podcasts/2025-14.mdx [moved from content/build-weekly-roundup/2025-14.mdx with 100% similarity]
content/podcasts/2025-15.mdx [moved from content/build-weekly-roundup/2025-15.mdx with 100% similarity]
content/podcasts/2025-17.mdx [moved from content/build-weekly-roundup/2025-17.mdx with 100% similarity]
content/podcasts/2025-18.mdx [moved from content/build-weekly-roundup/2025-18.mdx with 100% similarity]
content/podcasts/2025-19.mdx [moved from content/build-weekly-roundup/2025-19.mdx with 100% similarity]
content/podcasts/2025-20.mdx [moved from content/build-weekly-roundup/2025-20.mdx with 100% similarity]
content/podcasts/2025-21.mdx [moved from content/build-weekly-roundup/2025-21.mdx with 100% similarity]
content/podcasts/2025-23.mdx [moved from content/build-weekly-roundup/2025-23.mdx with 100% similarity]
content/podcasts/2025-24.mdx [moved from content/build-weekly-roundup/2025-24.mdx with 100% similarity]
content/podcasts/2025-25.mdx [moved from content/build-weekly-roundup/2025-25.mdx with 100% similarity]
content/podcasts/2025-26.mdx [moved from content/build-weekly-roundup/2025-26.mdx with 100% similarity]
content/podcasts/2025-29.mdx [moved from content/build-weekly-roundup/2025-29.mdx with 100% similarity]
content/podcasts/2025-30.mdx [moved from content/build-weekly-roundup/2025-30.mdx with 100% similarity]
content/podcasts/2025-33.mdx [moved from content/build-weekly-roundup/2025-33.mdx with 100% similarity]
content/podcasts/2025-36.mdx [moved from content/build-weekly-roundup/2025-36.mdx with 100% similarity]
content/podcasts/2025-37.mdx [moved from content/build-weekly-roundup/2025-37.mdx with 100% similarity]
content/podcasts/2025-38.mdx [moved from content/build-weekly-roundup/2025-38.mdx with 100% similarity]
content/podcasts/2025-39.mdx [moved from content/build-weekly-roundup/2025-39.mdx with 100% similarity]
content/podcasts/2025-40.mdx [moved from content/build-weekly-roundup/2025-40.mdx with 100% similarity]
content/podcasts/2025-41.mdx [moved from content/build-weekly-roundup/2025-41.mdx with 100% similarity]
content/podcasts/2025-42.mdx [moved from content/build-weekly-roundup/2025-42.mdx with 100% similarity]
content/podcasts/2025-43.mdx [moved from content/build-weekly-roundup/2025-43.mdx with 100% similarity]
content/podcasts/2025-44.mdx [moved from content/build-weekly-roundup/2025-44.mdx with 100% similarity]
content/podcasts/2025-45.mdx [moved from content/build-weekly-roundup/2025-45.mdx with 100% similarity]
content/podcasts/2025-46.mdx [moved from content/build-weekly-roundup/2025-46.mdx with 100% similarity]
src/components/metadata.astro
src/content.config.ts
src/pages/build-weekly-roundup/[id]/index.astro [deleted file]
src/pages/build-weekly-roundup/index.astro [deleted file]
src/pages/feed.xml.ts
src/pages/podcasts/[id]/index.astro [new file with mode: 0644]
src/pages/podcasts/[id]/opengraph.png.ts [moved from src/pages/build-weekly-roundup/[id]/opengraph.png.ts with 92% similarity]
src/pages/podcasts/index.astro [new file with mode: 0644]
src/utils/globals.ts

index 9f8a3061a503253c30ecfd227290ca429e178b2f..4114d687aa2357f50b069fddf13d563299b62c6e 100644 (file)
@@ -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;
index ced51c0ce77cdf5af134ddecba93f9bd994946c5..ea430e7b783fe10c20662dbd2756fe4d6668b8b4 100644 (file)
@@ -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 (file)
index f354468..0000000
+++ /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);
----
-<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
diff --git a/src/pages/build-weekly-roundup/index.astro b/src/pages/build-weekly-roundup/index.astro
deleted file mode 100644 (file)
index abbbfc2..0000000
+++ /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());
----
-
-<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
index 7cee878d63a66e5cccb8ab91b00bc806a267a8c3..583feb150acaea5ede7a1b6053d3d1b3e2c0d897 100644 (file)
@@ -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 (file)
index 0000000..074351f
--- /dev/null
@@ -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);
+---
+<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
similarity index 92%
rename from src/pages/build-weekly-roundup/[id]/opengraph.png.ts
rename to src/pages/podcasts/[id]/opengraph.png.ts
index c376dd4367a2532fc9a8ea12f31c4d27071d17a6..2d042cde6d622a5f4dfa751b66d37bdfa61e70fe 100644 (file)
@@ -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 (file)
index 0000000..26c89e9
--- /dev/null
@@ -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());
+---
+
+<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
index 89ac40e13c41043f0711475d0b0801388e483dbf..5e78b0551b8700ed1e8605602b9f6c2ee3baebac 100644 (file)
@@ -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" }
 ];