From 0f2b2ba0142dabae28a722cfe23311903ee3ae83 Mon Sep 17 00:00:00 2001 From: AdrianoDev Date: Sun, 5 Jul 2026 22:15:30 +0200 Subject: [PATCH] feat(blog): firma autore sotto il titolo, fallback Staff InsanityLab --- src/pages/blog/[slug].astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro index 34eda3e..634231e 100644 --- a/src/pages/blog/[slug].astro +++ b/src/pages/blog/[slug].astro @@ -3,18 +3,21 @@ import Base from '../../layouts/Base.astro'; import Sidebar from '../../components/blog/Sidebar.astro'; import { getDb } from '../../lib/db'; import { getPublishedBySlug } from '../../lib/posts'; +import { getUsernameById } from '../../lib/auth'; export const prerender = false; const post = getPublishedBySlug(getDb(), Astro.params.slug!); if (!post) return new Response(null, { status: 404 }); const fmt = new Intl.DateTimeFormat('it-IT', { dateStyle: 'long' }); +const author = post.author_id ? getUsernameById(getDb(), post.author_id) : null; +const byline = author ?? 'Staff InsanityLab'; ---
{post.cover && } -

{post.published_at && fmt.format(new Date(post.published_at))} · {post.category}

+

{post.published_at && fmt.format(new Date(post.published_at))} · {post.category} · di {byline}

{post.title}