{{ $article->title }}
@if($excerpt){{ $excerpt }}
@endif{{-- Blog card component — featured and compact variants (Story 5.8) --}} @props([ 'article', 'variant' => 'compact', 'locale' => app()->getLocale(), ]) @php $articleUrl = $article->publicUrl(); // Editor excerpt, else the first paragraph $excerpt = $article->summary(120); // Resolve thumbnail: OG image or first image block // The image is decorative here: the card title already names the link $thumbnail = $article->ogImageUrl(); if (! $thumbnail && !empty($article->blocks) && is_array($article->blocks)) { foreach ($article->blocks as $block) { if (($block['type'] ?? '') === 'image') { $imgPath = $block['data']['path'] ?? $block['data']['url'] ?? ''; if (is_array($imgPath)) { $imgPath = $imgPath[0] ?? ''; } if ($imgPath) { $thumbnail = str_starts_with($imgPath, 'http') ? $imgPath : \Illuminate\Support\Facades\Storage::disk('public')->url($imgPath); } break; } } } @endphp @if($variant === 'featured') {{-- Featured variant: large card, image beside text, full-width --}}
@else {{-- Compact variant: standard card for grid layout --}}{{ $excerpt }}
@endif