Conversation
WalkthroughAdds BlogPosting JSON-LD generation and injection for blog post pages, and centralizes blog home title/description into shared constants used by the blog layout. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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 Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/blog/src/app/`(blog)/[slug]/page.tsx:
- Around line 89-91: The current authorNames filter uses Boolean(author?.trim())
which calls trim on non-strings and can keep untrimmed values; update the logic
around page.data.authors so the predicate first narrows to strings (e.g., check
typeof author === "string"), call author.trim() inside the filter to test
emptiness, and then map the result to the trimmed string; modify the authorNames
assignment (the const authorNames) to implement this stronger type-guard and
trimming so authorNames is a string[] of trimmed names.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e0e12150-7202-41c1-ae13-7c6b2bcfde3d
📒 Files selected for processing (2)
apps/blog/src/app/(blog)/[slug]/page.tsxapps/blog/src/app/layout.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/blog/src/app/(blog)/[slug]/page.tsx (1)
79-80: Prefer falling back toexcerptbefore skipping JSON-LD.Line 79/Line 80 currently drop JSON-LD when
metaDescriptionanddescriptionare missing, even though the page already hasexcerpt(Line 204). Using it as a fallback improves coverage without changing schema quality much.♻️ Suggested patch
- const description = (page.data.metaDescription ?? page.data.description ?? "").trim(); - if (!title || !description) return null; + const description = ( + page.data.metaDescription ?? + page.data.description ?? + page.data.excerpt ?? + "" + ).trim(); + if (!title || !description) return null;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/blog/src/app/`(blog)/[slug]/page.tsx around lines 79 - 80, The current guard returns null when title or description is missing even though page.data.excerpt exists; update the logic that computes description (currently using page.data.metaDescription and page.data.description) to also fall back to page.data.excerpt before short-circuiting; adjust the condition that checks title/description (symbols: title, description, page.data.metaDescription, page.data.description, page.data.excerpt) so JSON-LD is emitted when an excerpt is available instead of returning null.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/blog/src/app/`(blog)/[slug]/page.tsx:
- Around line 79-80: The current guard returns null when title or description is
missing even though page.data.excerpt exists; update the logic that computes
description (currently using page.data.metaDescription and
page.data.description) to also fall back to page.data.excerpt before
short-circuiting; adjust the condition that checks title/description (symbols:
title, description, page.data.metaDescription, page.data.description,
page.data.excerpt) so JSON-LD is emitted when an excerpt is available instead of
returning null.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c050f66b-c9aa-4eca-b107-6388d26fde1c
📒 Files selected for processing (1)
apps/blog/src/app/(blog)/[slug]/page.tsx
Summary by CodeRabbit