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}