Description
src/features/blog/data/blogPosts.ts defines four posts total: featuredPost plus three entries in recentPosts (future-of-decentralized-development, cross-chain-collaboration, incentivizing-quality-contributions). Only featuredPost has a content field populated:
export const featuredPost: BlogPost = {
...
content:
'Grainlify connects talented open-source developers with innovative Web3 ' +
...
}
export const recentPosts: BlogPost[] = [
{
id: 1,
slug: 'future-of-decentralized-development',
title: 'The Future of Decentralized Development',
excerpt: 'Exploring how blockchain technology is transforming...',
date: 'December 20, 2024',
readTime: '6 min read',
category: 'Innovation',
icon: '🚀',
// no `content`
},
...
src/features/blog/pages/BlogArticlePage.tsx (the /dashboard/blog/:slug route rendered when a user clicks any BlogPostCard) only renders a body paragraph when content is present:
{post.content && (
<p className={...}>
{post.content}
</p>
)}
So clicking through to any of the three recentPosts articles from the blog listing (BlogPage.tsx → RecentPostsGrid → BlogPostCard) lands on a page showing only the title, date/read-time metadata, and the same short excerpt already shown on the listing card — no actual article body. The type for content in src/features/blog/types/index.ts is z.string().optional(), so this isn't a type error, but from a product standpoint three of the app's four blog articles are effectively broken deep links: a reader who clicks "Read More" gets nothing they hadn't already read on the listing page.
Requirements
- Populate a
content field for each of the three recentPosts entries currently missing one, so every post reachable via BlogPostCard/FeaturedPost has a real article body.
- Alternatively (if full article bodies aren't ready yet), suppress the "Read More" affordance / route entirely for posts lacking
content rather than linking to an effectively-empty article page.
Suggested execution
- Fork the repo and create a branch:
git checkout -b fix/blog-posts-missing-content
- Add a
content value to each of the three recentPosts entries in blogPosts.ts (or wire real content once available).
- Alternatively, in
BlogPostCard.tsx/FeaturedPost.tsx, only render the "Read More" link when post.content is present, and add a schema-level guard (see PENDING_FEATURES.md-style validation) ensuring future posts can't ship without one if it's meant to be required.
- Add a test asserting
BlogArticlePage renders a non-empty body for every slug present in blogPosts.ts.
Example commit message
fix: give every blog post real article content (or hide Read More when missing)
Acceptance criteria
Security notes
None; this is a content-completeness issue with no security surface.
Guidelines
- Minimum 95% test coverage
- Timeframe: 96 hours
Description
src/features/blog/data/blogPosts.tsdefines four posts total:featuredPostplus three entries inrecentPosts(future-of-decentralized-development,cross-chain-collaboration,incentivizing-quality-contributions). OnlyfeaturedPosthas acontentfield populated:src/features/blog/pages/BlogArticlePage.tsx(the/dashboard/blog/:slugroute rendered when a user clicks anyBlogPostCard) only renders a body paragraph whencontentis present:So clicking through to any of the three
recentPostsarticles from the blog listing (BlogPage.tsx→RecentPostsGrid→BlogPostCard) lands on a page showing only the title, date/read-time metadata, and the same short excerpt already shown on the listing card — no actual article body. Thetypeforcontentinsrc/features/blog/types/index.tsisz.string().optional(), so this isn't a type error, but from a product standpoint three of the app's four blog articles are effectively broken deep links: a reader who clicks "Read More" gets nothing they hadn't already read on the listing page.Requirements
contentfield for each of the threerecentPostsentries currently missing one, so every post reachable viaBlogPostCard/FeaturedPosthas a real article body.contentrather than linking to an effectively-empty article page.Suggested execution
git checkout -b fix/blog-posts-missing-contentcontentvalue to each of the threerecentPostsentries inblogPosts.ts(or wire real content once available).BlogPostCard.tsx/FeaturedPost.tsx, only render the "Read More" link whenpost.contentis present, and add a schema-level guard (seePENDING_FEATURES.md-style validation) ensuring future posts can't ship without one if it's meant to be required.BlogArticlePagerenders a non-empty body for every slug present inblogPosts.ts.Example commit message
Acceptance criteria
blogPosts.tsentries and asserts each either hascontentor is not linked as a full article.Security notes
None; this is a content-completeness issue with no security surface.
Guidelines