Files
InsanityLab-web/.superpowers/sdd/task-12-brief.md
T
Adriano b913a2bf90 registri dei piani in git (AI-OS#309)
Refs gitea:Adriano/AI-OS#310

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 10:36:26 +02:00

44 lines
1022 B
Markdown

### Task 12: Firma autore nel blog pubblico
**Files:**
- Modify: `src/pages/blog/[slug].astro`
**Interfaces:**
- Consumes: `getUsernameById` (auth.ts), `post.author_id`.
- [ ] **Step 1: Aggiungi la firma**
In `src/pages/blog/[slug].astro`, aggiungi l'import e calcola l'autore nel frontmatter:
```astro
import { getUsernameById } from '../../lib/auth';
```
Dopo `const post = getPublishedBySlug(...)` e il check 404, aggiungi:
```typescript
const author = post.author_id ? getUsernameById(getDb(), post.author_id) : null;
const byline = author ?? 'Staff InsanityLab';
```
Nel markup, cambia la riga meta per includere la firma:
```astro
<p class="art__meta">{post.published_at && fmt.format(new Date(post.published_at))} · {post.category} · di {byline}</p>
```
- [ ] **Step 2: Verifica build**
Run: `npm run build`
Expected: build OK.
- [ ] **Step 3: Commit**
```bash
git add src/pages/blog/[slug].astro
git commit -m "feat(blog): firma autore sotto il titolo, fallback Staff InsanityLab"
```
---