Show updated date on blog post cards#8013
Conversation
Thread an optional updatedAt field from post frontmatter through the card
builders to the PostCard UI, rendering "Updated {date}" alongside the
original publish date (separated by a "|" when both are present). Surfaces
refresh dates on the series and home listings.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds an optional ChangesupdatedAt Propagation
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/blog/src/app/(blog)/page.tsx (1)
93-99: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMinor inconsistency: unlike
dateISOabove, this block skips the try/catch.The
dateISOcomputation just above wrapsnew Date(data.date)in try/catch; this newupdatedAtISOblock doesn't, despite parsing similarly untrusted frontmatter data. Low risk sincenew Date()rarely throws for string/Date inputs, but worth aligning for consistency.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/blog/src/app/`(blog)/page.tsx around lines 93 - 99, The updatedAtISO parsing block in page.tsx is inconsistent with the dateISO logic because it does not use the same try/catch pattern around untrusted frontmatter parsing. Update the updatedAtISO computation in the same render/data-prep flow as dateISO to mirror that error-handling style, using the existing data.updatedAt handling and keeping the fallback to null if parsing fails.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/blog/src/app/`(blog)/page.tsx:
- Around line 93-99: The updatedAtISO parsing block in page.tsx is inconsistent
with the dateISO logic because it does not use the same try/catch pattern around
untrusted frontmatter parsing. Update the updatedAtISO computation in the same
render/data-prep flow as dateISO to mirror that error-handling style, using the
existing data.updatedAt handling and keeping the fallback to null if parsing
fails.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e89e48e7-646d-465f-9f0e-18efc53c7127
📒 Files selected for processing (6)
apps/blog/src/app/(blog)/page.tsxapps/blog/src/app/(blog)/series/[key]/page.tsxapps/blog/src/components/BlogGrid.tsxapps/blog/src/components/PostCard.tsxapps/blog/src/lib/post-card-item.tspackages/ui/src/components/post-card.tsx
What
Renders an Updated {date} label on blog post cards alongside the original publish date, separated by a
|when both are present.Threads an optional
updatedAtfield (already defined insource.config.tsasz.coerce.date().optional()) from post frontmatter through the card builders to the sharedPostCardUI component:packages/ui/src/components/post-card.tsx— addsupdatedAtto the type and renders the label +|separator (aria-hidden, only shown when both dates exist)apps/blog/src/components/PostCard.tsx— passes a formattedupdatedAtthroughapps/blog/src/components/BlogGrid.tsx— addsupdatedAttoBlogCardItemapps/blog/src/lib/post-card-item.ts,apps/blog/src/app/(blog)/page.tsx,apps/blog/src/app/(blog)/series/[key]/page.tsx— each computeupdatedAtISOfrom frontmatter withNaNguardsWhy
Surfaces refresh dates on the series and home listings, supporting the blog-refresh program's ability to tie content updates to visitor changes.
Testing
tsc --noEmitpasses clean<original date> | Updated July 3, 2026; posts withoutupdatedAtshow no label🤖 Generated with Claude Code
Summary by CodeRabbit