diff --git a/src/content.config.ts b/src/content.config.ts index 1eaa099..1d6f97f 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -19,6 +19,8 @@ const posts = defineCollection({ publishedAt: z.coerce.date(), updatedAt: z.coerce.date().optional(), + blurb: z.string().optional(), + draft: z.boolean().default(false), tags: z.array(z.string()).default([]), diff --git a/src/content/posts/hello-world.md b/src/content/posts/hello-world.md index 1bf323c..4f43f60 100644 --- a/src/content/posts/hello-world.md +++ b/src/content/posts/hello-world.md @@ -2,6 +2,8 @@ title: "Hello, world!" description: "The first post." publishedAt: 2026-09-21 +updatedAt: 2026-10-14 +blurb: "A brief introduction." tags: - hello-world --- diff --git a/src/lib/client/tic-tac-toe.ts b/src/lib/client/tic-tac-toe.ts index 7c73409..ee9b1e2 100644 --- a/src/lib/client/tic-tac-toe.ts +++ b/src/lib/client/tic-tac-toe.ts @@ -64,7 +64,7 @@ export function initTicTacToe(root: HTMLElement): () => void { session.state.turn !== session.humanMark) ) return; - console.log("[TicTacToe] Square pressed:", square); + //console.log("[TicTacToe] Square pressed:", square); commitMove(square); scheduleCpuTurn(); } @@ -102,7 +102,7 @@ export function initTicTacToe(root: HTMLElement): () => void { } function handleDifficultyPress(difficulty: Difficulty): void { - console.log("[TicTacToe] Difficulty pressed:", difficulty); + //("[TicTacToe] Difficulty pressed:", difficulty); if (session.difficulty === difficulty) return; cancelCpuTurn(); diff --git a/src/pages/posts/[...id].astro b/src/pages/posts/[...id].astro index b89425f..e397452 100644 --- a/src/pages/posts/[...id].astro +++ b/src/pages/posts/[...id].astro @@ -2,6 +2,7 @@ import { render } from "astro:content"; import { getPosts } from "../../lib/posts/selectors"; import ContentLayout from "../../layouts/ContentLayout.astro"; +import ItemBox from "../../components/ui/ItemBox.astro"; export async function getStaticPaths() { const posts = await getPosts(); @@ -18,8 +19,121 @@ export async function getStaticPaths() { const { post } = Astro.props; const { Content } = await render(post); + +const publishedAt = post.data.publishedAt; +const updatedAt = post.data.updatedAt; +const blurb = post.data.blurb; + +const formatDate = (date: Date) => + date.toLocaleDateString("en-US", { + year: "numeric", + month: "short", + day: "numeric", + }); --- - + + + {post.data.title} + + + + + Published {formatDate(publishedAt)} + + {updatedAt && ( + Updated {formatDate(updatedAt)} + )} + + + {blurb && {blurb}} + + + + + + + + + +
{blurb}