New Feature·Pushed May 1, 2026·M
Content collection infrastructure enables story rendering
GitPulse can now render development activity as editorial stories — new content collection reads JSON files to power a feed page and individual story pages, with static generation at build time.
Development activity on a project can now appear as short editorial stories. The system reads story data from JSON files and renders two story types: merged pull requests and direct pushes to the default branch. A feed page displays all stories chronologically, while each story gets its own detail page with the full narrative, author byline, and links back to the source on GitHub.
This establishes the data-to-site plumbing. Stories are stored as JSON in the content directory, read by load functions, and rendered through a StoryCard component that handles both story types. Static pages are generated at build time via generateStaticParams, so the build output includes pre-rendered story routes.
Two stub fixtures verify the visual design works before the analyzer produces real content. One simulates a merged PR story; the other simulates a direct push. Both include headlines, standfirsts, and body text written in a deadpan editorial voice.
Technical description
This commit establishes the content collection system for rendering development activity as editorial stories.
**Core Architecture**
Stories are modeled as a discriminated union in [[code ref=1]]Story[[/code]], with two concrete types: [[code ref=2]]PRStory[[/code]] (for merged pull requests) and [[code ref=3]]DirectPushStory[[/code]] (for commits pushed directly to the default branch). Each type extends [[code]]StoryBase[[/code]] with type-specific fields: PRStory includes [[code]]prNumber[[/code]] and [[code]]prUrl[[/code]], while DirectPushStory uses [[code]]commitUrl[[/code]].
The [[code ref=4]]loadStories[[/code]] function reads all [[code]].json[[/code]] files from the content directory, parses them, and returns them sorted by [[code]]committedAt[[/code]] in descending order. The [[code ref=5]]loadStory[[/code]] function is a convenience wrapper that finds a single story by ID.
**Rendering Pipeline**
The [[code ref=6]]StoryCard[[/code]] component renders story previews in the feed, displaying the kind label ("merged" or "direct push"), date, headline, standfirst, and author byline with a link to the story detail page. The homepage maps over all loaded stories, rendering each through StoryCard. When no stories exist, a friendly empty state message is displayed.
The [[code ref=7]]StoryPage[[/code]] renders individual story detail pages. [[code]]generateStaticParams[[/code]] enumerates all story IDs at build time, so the static build emits pre-rendered routes for each story. The detail view shows the full body text, formatted date, author (with link if available), and a link to the source (PR or commit) on GitHub.
**Fixtures**
Two JSON fixtures provide stub content to verify the visual design:
- [[code]]example-merged-pr.json[[/code]]: simulates a merged PR with the headline "Cache layer learns to forget what it never needed to know"
- [[code]]example-direct-push.json[[/code]]: simulates a direct push with the headline "A typo in the readme, fixed at the speed of caffeine"
These fixtures will be replaced once the analyzer component is built.
**Files at a Glance**
- [[code]]src/lib/stories.ts[[/code]]: Story types and data loading functions
- [[code]]src/components/StoryCard.tsx[[/code]]: Feed card component
- [[code]]src/app/page.tsx[[/code]]: Homepage with feed rendering and empty state
- [[code]]src/app/stories/[id]/page.tsx[[/code]]: Individual story detail page with static generation
- [[code]]src/content/stories/example-merged-pr.json[[/code]]: Stub fixture for PR stories
- [[code]]src/content/stories/example-direct-push.json[[/code]]: Stub fixture for direct push stories
Categories
- New Feature (85%) — Core purpose: adds content collection, feed rendering, and static page generation for displaying development activity as editorial stories
- Configuration (10%) — Content directory structure with JSON fixtures as the story data format
- Tests (5%) — Stub fixtures provide visual test data to verify design before real content exists