From 2c7d004f37a02834d610c3fcea29152146ddc8de Mon Sep 17 00:00:00 2001 From: Inline Pizza <249805557+InlinePizza@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:13:30 -0800 Subject: [PATCH] Add author field and Opinion section to blog post Add optional author field to blog schema and display it on both the listing and individual post pages. Update the new blog post with author "InlinePizza" and section "Opinion". Co-Authored-By: Claude Opus 4.6 --- src/content.config.ts | 1 + .../technical/writing-code-was-hard-actually.mdx | 3 ++- src/pages/blog/[...slug].astro | 3 +++ src/pages/blog/index.astro | 3 +++ src/styles/custom.css | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/content.config.ts b/src/content.config.ts index 9dffb76..512ba12 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -13,6 +13,7 @@ const blog = defineCollection({ title: z.string(), description: z.string(), subtitle: z.string().optional(), + author: z.string().optional(), section: z.string().optional(), date: z.coerce.date(), hidden: z.boolean().optional().default(false), diff --git a/src/content/blog/technical/writing-code-was-hard-actually.mdx b/src/content/blog/technical/writing-code-was-hard-actually.mdx index 2dcf984..907dfb7 100644 --- a/src/content/blog/technical/writing-code-was-hard-actually.mdx +++ b/src/content/blog/technical/writing-code-was-hard-actually.mdx @@ -5,8 +5,9 @@ description: >- The revisionist claim that writing code was never the hard part arrives conveniently at the moment AI makes it cheap to produce. But the market, the machine, and the engineers who built it all tell a different story. +author: InlinePizza date: '2026-02-24T00:00:00.000Z' -section: Technical +section: Opinion hidden: false --- diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index c1b901a..1abba14 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -27,6 +27,9 @@ const { Content, headings } = await render(entry); + {entry.data.author && ( +

By {entry.data.author}

+ )}

{entry.data.title}

+ {entry.data.author && ( +

By {entry.data.author}

+ )} {(entry.data.description || entry.data.subtitle) && (

{entry.data.description || entry.data.subtitle}

)} diff --git a/src/styles/custom.css b/src/styles/custom.css index a839321..5833c0e 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -642,6 +642,20 @@ main:has(.pl-site-page.pl-site-page-compact) .content-panel + .content-panel { text-decoration: underline; } +.collection-feed-author { + margin: 0; + color: var(--sl-color-gray-3); + font-size: var(--sl-text-xs); + font-weight: 500; +} + +.collection-post-author { + margin: 0 0 1.5rem; + color: var(--sl-color-gray-3); + font-size: var(--sl-text-sm); + font-weight: 500; +} + .collection-feed-description { margin: 0; max-width: 72ch;