feat(web): add dynamic og image generation for blog articles#2084
feat(web): add dynamic og image generation for blog articles#2084ComputelessComputer merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe change modifies article card rendering in the blog view to compute per-article ogImage values derived from article.coverImage or constructed from metadata (type, title, author, date). This replaces prior conditional rendering of article.coverImage with consistent image rendering using the computed ogImage. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12-15 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/web/src/routes/_view/index.tsx (2)
1947-1953: Add a fallback chain foraltto avoid missing alt text.Right now
alt={article.display_title}can end up undefined ifdisplay_titleisn’t set, which isn’t great for accessibility on a non‑decorative image.You can mirror the heading fallback:
- <img - src={ogImage} - alt={article.display_title} + <img + src={ogImage} + alt={article.display_title || article.meta_title || article.title} className="w-full h-full object-cover group-hover:scale-105 transition-all duration-500" />
1935-1937: Extract the OG base URL to a constant to reduce duplication.The OG URL fallback is well-encoded and guards optional fields correctly. However, the
"https://hyprnote.com/og"base URL is hard-coded across multiple files (index.tsx, blog/$slug.tsx, templates, gallery, docs, shortcuts, changelog). Extract this to a shared constant so it can be updated in one place without code changes.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/src/routes/_view/index.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, usecn(import from@hypr/utils). It is similar toclsx. Always pass an array and split by logical grouping.
Usemotion/reactinstead offramer-motion.
Files:
apps/web/src/routes/_view/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Redirect rules - hyprnote
- GitHub Check: Header rules - hyprnote
- GitHub Check: Pages changed - hyprnote
- GitHub Check: ci
- GitHub Check: fmt
No description provided.