Add preview feature for articles - #941
Conversation
|
@NiallJoeMaher is attempting to deploy a commit to the Codú Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review failedThe pull request is closed. WalkthroughThe recent updates introduce functionality for generating metadata and rendering post previews using React and Markdoc parsing. Additionally, they enhance the server-side logic for fetching post previews and update the robots.txt configuration to disallow the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant Browser
participant Server
participant Markdoc
participant React
User->>Browser: Navigate to /draft/[id]
Browser->>Server: Request post preview data
Server->>Server: Fetch data using getPostPreview
Server->>Browser: Send post preview data
Browser->>React: Render PreviewPage component
React->>Markdoc: Parse post content
Markdoc->>React: Return parsed content
React->>Browser: Display post preview
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
app/(app)/draft/[id]/page.tsx (1)
38-38: Consider removing the debug statement before merging to maintain clean production code.server/lib/posts.ts (1)
74-74: Consider removing the debug statement to maintain clean production code.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- app/(app)/draft/[id]/page.tsx (1 hunks)
- app/robots.ts (1 hunks)
- server/lib/posts.ts (3 hunks)
Files skipped from review due to trivial changes (1)
- app/robots.ts
Additional comments not posted (4)
app/(app)/draft/[id]/page.tsx (2)
16-34: The implementation ofgenerateMetadatafunction looks robust and handles edge cases well.
37-78: ThePreviewPagecomponent is well-structured and handles edge cases appropriately.server/lib/posts.ts (2)
13-22: TheGetPreviewSchemaand its inferred type are correctly defined and follow best practices for type safety.
70-111: ThegetPostPreviewfunction is well-implemented with robust error handling and proper use of async/await patterns.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✨ Codu Pull Request 💻
Pull Request details
draft/POST_IDto share preview of unpublished articles