# Story 5.4: Public Posts Display ## Epic Reference **Epic 5:** Posts/Blog System ## User Story As a **website visitor**, I want **to view published blog posts**, So that **I can read legal updates and articles from the firm**. ## Story Context ### Existing System Integration - **Integrates with:** posts table (published only) - **Technology:** Livewire Volt (public routes) - **Follows pattern:** Public content display - **Touch points:** Navigation, homepage ## Acceptance Criteria ### Posts Listing Page - [ ] Public access (no login required) - [ ] Display in reverse chronological order - [ ] Each post card shows: - Title - Publication date - Excerpt (first ~150 characters) - Read more link - [ ] Pagination for many posts ### Individual Post Page - [ ] Full post content displayed - [ ] Clean, readable typography - [ ] Publication date shown - [ ] Back to posts list link ### Language Support - [ ] Content displayed based on current site language - [ ] Title and body in selected language - [ ] Date formatting per locale ### Design Requirements - [ ] Responsive design (mobile-friendly) - [ ] Professional typography - [ ] Consistent with brand colors ### Quality Requirements - [ ] Only published posts visible - [ ] Fast loading - [ ] SEO-friendly URLs (optional per PRD) - [ ] Tests for display logic ## Technical Notes ### Routes ```php // routes/web.php (public) Route::get('/posts', \App\Livewire\Posts\Index::class)->name('posts.index'); Route::get('/posts/{post}', \App\Livewire\Posts\Show::class)->name('posts.show'); ``` ### Posts Index Component ```php Post::published() ->latest() ->paginate(10), ]; } }; ?>
{{ __('posts.title') }}
@forelse($posts as $post) @empty

{{ __('posts.no_posts') }}

@endforelse
{{ $posts->links() }}
``` ### Post Show Component ```php status === 'published', 404); $this->post = $post; } }; ?>
{{ $post->title }}
{!! $post->body !!}
``` ### Prose Styling ```css /* In app.css */ .prose-navy { --tw-prose-headings: theme('colors.navy'); --tw-prose-links: theme('colors.gold'); --tw-prose-bold: theme('colors.navy'); } .prose-navy a { text-decoration: underline; } .prose-navy a:hover { color: theme('colors.gold-light'); } ``` ## Definition of Done - [ ] Posts listing page works - [ ] Individual post page works - [ ] Only published posts visible - [ ] Reverse chronological order - [ ] Excerpts display correctly - [ ] Full content renders properly - [ ] Language-appropriate content shown - [ ] Mobile responsive - [ ] RTL support - [ ] Tests pass - [ ] Code formatted with Pint ## Dependencies - **Story 5.1:** Post creation - **Epic 1:** Base UI, navigation ## Estimation **Complexity:** Medium **Estimated Effort:** 3-4 hours