b913a2bf90
Refs gitea:Adriano/AI-OS#310 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
47 lines
1.7 KiB
Diff
47 lines
1.7 KiB
Diff
# Review package: 2bf6b3d..0f2b2ba
|
|
|
|
## Commits
|
|
0f2b2ba feat(blog): firma autore sotto il titolo, fallback Staff InsanityLab
|
|
|
|
## Files changed
|
|
src/pages/blog/[slug].astro | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
## Diff
|
|
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
|
|
@@ -1,27 +1,30 @@
|
|
---
|
|
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';
|
|
---
|
|
<Base title={post.title} description={post.excerpt}>
|
|
<section class="section">
|
|
<div class="container art">
|
|
<article>
|
|
{post.cover && <img class="art__cover" src={post.cover} alt="" />}
|
|
- <p class="art__meta">{post.published_at && fmt.format(new Date(post.published_at))} · {post.category}</p>
|
|
+ <p class="art__meta">{post.published_at && fmt.format(new Date(post.published_at))} · {post.category} · di {byline}</p>
|
|
<h1>{post.title}</h1>
|
|
<div class="art__body" set:html={post.body_html} />
|
|
</article>
|
|
<Sidebar />
|
|
</div>
|
|
</section>
|
|
</Base>
|
|
|
|
<style>
|
|
.art { display: grid; grid-template-columns: 2.4fr 1fr; gap: 60px; }
|